MCPcopy Create free account
hub / github.com/boostorg/json / add_impl

Function add_impl

bench/bench-conv.cpp:792–838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790};
791
792bool
793add_impl(impl_list & vi, char kind, char alloc, char num)
794{
795 parse_options popts;
796 switch(num)
797 {
798 case 'i':
799 popts.numbers = number_precision::imprecise;
800 break;
801 case 'p':
802 popts.numbers = number_precision::precise;
803 break;
804 case 'n':
805 popts.numbers = number_precision::none;
806 break;
807 default:
808 return false;
809 }
810 bool const is_pool = alloc == 'p';
811
812 impl_ptr impl;
813 switch(kind)
814 {
815 case 'b':
816 impl.reset( new boost_impl(is_pool, popts) );
817 break;
818
819 case 's':
820 impl.reset( new boost_simple_impl(is_pool, popts) );
821 break;
822
823 case 'o':
824 impl.reset( new boost_operator_impl(is_pool, popts) );
825 break;
826
827 case 'd':
828 impl.reset( new boost_direct_impl(popts) );
829 break;
830
831 default:
832 std::cerr << "Unknown implementation: '" << kind << "'\n";
833 return false;
834 }
835
836 vi.emplace_back( std::move(impl) );
837 return true;
838}
839
840} // namespace
841

Callers 1

mainFunction · 0.70

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected