@@ -16,15 +16,15 @@ using ceph::decode;
1616namespace {
1717
1818template <typename E>
19- class GetTypeVisitor : public boost ::static_visitor<E> {
19+ class GetTypeVisitor {
2020public:
2121 template <typename T>
2222 inline E operator ()(const T&) const {
2323 return T::TYPE;
2424 }
2525};
2626
27- class EncodeVisitor : public boost ::static_visitor< void > {
27+ class EncodeVisitor {
2828public:
2929 explicit EncodeVisitor (bufferlist &bl) : m_bl(bl) {
3030 }
@@ -38,7 +38,7 @@ class EncodeVisitor : public boost::static_visitor<void> {
3838 bufferlist &m_bl;
3939};
4040
41- class DecodeVisitor : public boost ::static_visitor< void > {
41+ class DecodeVisitor {
4242public:
4343 DecodeVisitor (__u8 version, bufferlist::const_iterator &iter)
4444 : m_version(version), m_iter(iter) {
@@ -53,7 +53,7 @@ class DecodeVisitor : public boost::static_visitor<void> {
5353 bufferlist::const_iterator &m_iter;
5454};
5555
56- class DumpVisitor : public boost ::static_visitor< void > {
56+ class DumpVisitor {
5757public:
5858 explicit DumpVisitor (Formatter *formatter, const std::string &key)
5959 : m_formatter(formatter), m_key(key) {}
@@ -411,12 +411,12 @@ void UnknownEvent::dump(Formatter *f) const {
411411}
412412
413413EventType EventEntry::get_event_type () const {
414- return boost::apply_visitor (GetTypeVisitor<EventType>(), event);
414+ return std::visit (GetTypeVisitor<EventType>(), event);
415415}
416416
417417void EventEntry::encode (bufferlist& bl) const {
418418 ENCODE_START (5 , 1 , bl);
419- boost::apply_visitor (EncodeVisitor (bl), event);
419+ std::visit (EncodeVisitor (bl), event);
420420 ENCODE_FINISH (bl);
421421 encode_metadata (bl);
422422}
@@ -494,15 +494,15 @@ void EventEntry::decode(bufferlist::const_iterator& it) {
494494 break ;
495495 }
496496
497- boost::apply_visitor (DecodeVisitor (struct_v, it), event);
497+ std::visit (DecodeVisitor (struct_v, it), event);
498498 DECODE_FINISH (it);
499499 if (struct_v >= 4 ) {
500500 decode_metadata (it);
501501 }
502502}
503503
504504void EventEntry::dump (Formatter *f) const {
505- boost::apply_visitor (DumpVisitor (f, " event_type" ), event);
505+ std::visit (DumpVisitor (f, " event_type" ), event);
506506 f->dump_stream (" timestamp" ) << timestamp;
507507}
508508
@@ -689,12 +689,12 @@ void UnknownClientMeta::dump(Formatter *f) const {
689689}
690690
691691ClientMetaType ClientData::get_client_meta_type () const {
692- return boost::apply_visitor (GetTypeVisitor<ClientMetaType>(), client_meta);
692+ return std::visit (GetTypeVisitor<ClientMetaType>(), client_meta);
693693}
694694
695695void ClientData::encode (bufferlist& bl) const {
696696 ENCODE_START (2 , 1 , bl);
697- boost::apply_visitor (EncodeVisitor (bl), client_meta);
697+ std::visit (EncodeVisitor (bl), client_meta);
698698 ENCODE_FINISH (bl);
699699}
700700
@@ -720,12 +720,12 @@ void ClientData::decode(bufferlist::const_iterator& it) {
720720 break ;
721721 }
722722
723- boost::apply_visitor (DecodeVisitor (struct_v, it), client_meta);
723+ std::visit (DecodeVisitor (struct_v, it), client_meta);
724724 DECODE_FINISH (it);
725725}
726726
727727void ClientData::dump (Formatter *f) const {
728- boost::apply_visitor (DumpVisitor (f, " client_meta_type" ), client_meta);
728+ std::visit (DumpVisitor (f, " client_meta_type" ), client_meta);
729729}
730730
731731void ClientData::generate_test_instances (std::list<ClientData *> &o) {
0 commit comments