3434#include < string>
3535#include < map>
3636#include < set>
37- #include < boost/ optional.hpp >
37+ #include < optional>
3838#include " ../buffer.h"
3939#include " ../consumer.h"
4040#include " ../macros.h"
@@ -106,8 +106,8 @@ class CPPKAFKA_API CompactedTopicEvent {
106106 EventType type_;
107107 std::string topic_;
108108 int partition_;
109- boost ::optional<Key> key_;
110- boost ::optional<Value> value_;
109+ std ::optional<Key> key_;
110+ std ::optional<Value> value_;
111111};
112112
113113template <typename Key, typename Value>
@@ -121,12 +121,12 @@ class CPPKAFKA_API CompactedTopicProcessor {
121121 /* *
122122 * Callback used for decoding key objects
123123 */
124- using KeyDecoder = std::function<boost ::optional<Key>(const Buffer&)>;
124+ using KeyDecoder = std::function<std ::optional<Key>(const Buffer&)>;
125125
126126 /* *
127127 * Callback used for decoding value objects
128128 */
129- using ValueDecoder = std::function<boost ::optional<Value>(const Key& key, const Buffer&)>;
129+ using ValueDecoder = std::function<std ::optional<Value>(const Key& key, const Buffer&)>;
130130
131131 /* *
132132 * Callback used for event handling
@@ -276,10 +276,10 @@ void CompactedTopicProcessor<Key, Value>::process_event() {
276276 Message message = consumer_.poll ();
277277 if (message) {
278278 if (!message.get_error ()) {
279- boost ::optional<Key> key = key_decoder_ (message.get_key ());
279+ std ::optional<Key> key = key_decoder_ (message.get_key ());
280280 if (key) {
281281 if (message.get_payload ()) {
282- boost ::optional<Value> value = value_decoder_ (*key, message.get_payload ());
282+ std ::optional<Value> value = value_decoder_ (*key, message.get_payload ());
283283 if (value) {
284284 // If there's a payload and we managed to parse the value, generate a
285285 // SET_ELEMENT event
0 commit comments