@@ -661,30 +661,30 @@ namespace eosio { namespace chain {
661661
662662 auto & b = path.back ();
663663
664- EOS_ASSERT ( b. contains <array_index_path_item>(), abi_exception, " trying to set array index without first pushing new array index item" );
664+ EOS_ASSERT ( std::holds_alternative <array_index_path_item>(b ), abi_exception, " trying to set array index without first pushing new array index item" );
665665
666- b. get <array_index_path_item>().array_index = i;
666+ std:: get<array_index_path_item>(b ).array_index = i;
667667 }
668668
669669 void abi_traverse_context_with_path::hint_array_type_if_in_array () {
670- if ( path.size () == 0 || !path.back (). contains <array_index_path_item>( ) )
670+ if ( path.size () == 0 || !std::holds_alternative<array_index_path_item>( path.back ()) )
671671 return ;
672672
673- path. back (). get <array_index_path_item>().type_hint = array_type_path_root{};
673+ std:: get<array_index_path_item>(path. back () ).type_hint = array_type_path_root{};
674674 }
675675
676676 void abi_traverse_context_with_path::hint_struct_type_if_in_array ( const map<type_name, struct_def>::const_iterator& itr ) {
677- if ( path.size () == 0 || !path.back (). contains <array_index_path_item>( ) )
677+ if ( path.size () == 0 || !std::holds_alternative<array_index_path_item>( path.back ()) )
678678 return ;
679679
680- path. back (). get <array_index_path_item>().type_hint = struct_type_path_root{ .struct_itr = itr };
680+ std:: get<array_index_path_item>(path. back () ).type_hint = struct_type_path_root{ .struct_itr = itr };
681681 }
682682
683683 void abi_traverse_context_with_path::hint_variant_type_if_in_array ( const map<type_name, variant_def>::const_iterator& itr ) {
684- if ( path.size () == 0 || !path.back (). contains <array_index_path_item>( ) )
684+ if ( path.size () == 0 || !std::holds_alternative<array_index_path_item>( path.back ()) )
685685 return ;
686686
687- path. back (). get <array_index_path_item>().type_hint = variant_type_path_root{ .variant_itr = itr };
687+ std:: get<array_index_path_item>(path. back () ).type_hint = variant_type_path_root{ .variant_itr = itr };
688688 }
689689
690690 constexpr size_t const_strlen ( const char * str )
@@ -804,13 +804,13 @@ namespace eosio { namespace chain {
804804
805805 void operator ()( const array_index_path_item& item ) {
806806 const auto & th = item.type_hint ;
807- if ( th. contains <struct_type_path_root>() ) {
808- const auto & str = th. get <struct_type_path_root>().struct_itr ->first ;
807+ if ( std::holds_alternative <struct_type_path_root>(th ) ) {
808+ const auto & str = std:: get<struct_type_path_root>(th ).struct_itr ->first ;
809809 output_name ( s, str, shorten_names );
810- } else if ( th. contains <variant_type_path_root>() ) {
811- const auto & str = th. get <variant_type_path_root>().variant_itr ->first ;
810+ } else if ( std::holds_alternative <variant_type_path_root>(th ) ) {
811+ const auto & str = std:: get<variant_type_path_root>(th ).variant_itr ->first ;
812812 output_name ( s, str, shorten_names );
813- } else if ( th. contains <array_type_path_root>() ) {
813+ } else if ( std::holds_alternative <array_type_path_root>(th ) ) {
814814 s << " ARRAY" ;
815815 } else {
816816 s << " UNKNOWN" ;
@@ -834,21 +834,21 @@ namespace eosio { namespace chain {
834834
835835 generate_path_string_visitor visitor (shorten_names, !full_path);
836836 if ( full_path )
837- root_of_path. visit ( visitor );
837+ std:: visit ( visitor, root_of_path );
838838 for ( size_t i = 0 , n = path.size (); i < n; ++i ) {
839- if ( full_path && !path[i]. contains <array_index_path_item>() )
839+ if ( full_path && !std::holds_alternative <array_index_path_item>(path[i] ) )
840840 visitor.add_dot ();
841841
842- path[i]. visit ( visitor );
842+ std:: visit ( visitor, path[i] );
843843
844844 }
845845
846846 if ( !full_path ) {
847- if ( visitor. last_path_item . contains <empty_path_item>() ) {
848- root_of_path. visit ( visitor );
847+ if ( std::holds_alternative <empty_path_item>(visitor. last_path_item ) ) {
848+ std:: visit ( visitor, root_of_path );
849849 } else {
850850 path_item_type_visitor vis2 (visitor.s , shorten_names);
851- visitor. last_path_item . visit (vis2);
851+ std:: visit (vis2, visitor. last_path_item );
852852 }
853853 }
854854
0 commit comments