std::common_type用法

common_type函数 包含于<type_traits>当中。

作用是返回参数列表中的参数都可以转换成的类型(有些拗口)。

C++11中的用法为

syd::common_type<int,float,double>::type        // 返回值为double

#include <iostream>
#include <type_traits>
int main()
{
    typedef std::common_type<int, float, double>::type test;
    std::cout << "test is a int " << std::is_same<int, test>::value<< std::endl;
    std::cout << "test is a float " << std::is_same<float, test>::value<< std::endl;
    std::cout << "test is a double " << std::is_same<double, test>::value << std::endl;;
    system("pause");
    return 0;
}

std::common_type<char,std::string>::type        // 报错,无法互相转换



在C++ 14中,我们可以用 std::common_type_t<>来代替。



[ 89%] Built target service_main In file included from /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/include/mock_rh_return_serialization.h:12, from /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/source/mock_rh.cpp:9: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp: In instantiation of ‘std::pair<_Tp1, _Tp2> nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(BasicJsonType&&, nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<_Tp1, _Tp2> >, nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; A1 = const std::__cxx11::basic_string<char>; A2 = BNE::RH::BusinessResultParameter]’: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5271:32: required from ‘decltype (nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(forward<BasicJsonType>(j), forward<TupleRelated>(t), nlohmann::json_abi_v3_11_3::detail::priority_tag<3>{})) nlohmann::json_abi_v3_11_3::detail::from_json(BasicJsonType&&, TupleRelated&&) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; TupleRelated = nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >; decltype (nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(forward<BasicJsonType>(j), forward<TupleRelated>(t), nlohmann::json_abi_v3_11_3::detail::priority_tag<3>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5333:25: required from ‘decltype (nlohmann::json_abi_v3_11_3::detail::from_json(j, forward<T>(val))) nlohmann::json_abi_v3_11_3::detail::from_json_fn::operator()(const BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::json_abi_v3_11_3::basic_json<>; T = nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >; decltype (nlohmann::json_abi_v3_11_3::detail::from_json(j, forward<T>(val))) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:6139:37: required from ‘static decltype (nlohmann::json_abi_v3_11_3::from_json(forward<BasicJsonType>(j), nlohmann::json_abi_v3_11_3::detail::identity_tag<TargetType>{})) nlohmann::json_abi_v3_11_3::adl_serializer<T, SFINAE>::from_json(BasicJsonType&&) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; TargetType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; <template-parameter-1-2> = void; decltype (nlohmann::json_abi_v3_11_3::from_json(forward<BasicJsonType>(j), nlohmann::json_abi_v3_11_3::detail::identity_tag<TargetType>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21677:52: required from ‘ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<1>) const [with ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::has_non_default_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21779:35: required from ‘constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void; decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t = nlohmann::json_abi_v3_11_3::basic_json<>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5099:75: [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ] /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21636:45: required from ‘ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) const [with ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<(nlohmann::json_abi_v3_11_3::detail::is_default_constructible<ValueType>::value && nlohmann::json_abi_v3_11_3::detail::has_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21779:35: required from ‘constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void; decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t = nlohmann::json_abi_v3_11_3::basic_json<>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21925:30: required from ‘nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::operator ValueType() const [with ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::conjunction<nlohmann::json_abi_v3_11_3::detail::negation<std::is_pointer<_Ptr> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<_Up, std::nullptr_t> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, nlohmann::json_abi_v3_11_3::detail::json_ref<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass> > > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, typename StringType::value_type> >, nlohmann::json_abi_v3_11_3::detail::negation<nlohmann::json_abi_v3_11_3::detail::is_basic_json<BasicJsonType> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::initializer_list<typename StringType::value_type> > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::basic_string_view<char, std::char_traits<char> > > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::any> >, nlohmann::json_abi_v3_11_3::detail::is_detected_lazy<nlohmann::json_abi_v3_11_3::detail::get_template_function, const nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>&, ValueType> >::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /usr/include/c++/11/bits/unique_ptr.h:962:30: required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; _Args = {nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/common/json/json_serializer.h:44:39: required from ‘static std::unique_ptr<_Tp> JsonSerializer<T>::loadFromFile(const string&) [with T = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; std::string = std::__cxx11::basic_string<char>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/include/mock_rh_return_data.h:43:77: required from here /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5241:66: error: no matching function for call to ‘nlohmann::json_abi_v3_11_3::basic_json<>::get<BNE::RH::BusinessResultParameter>() const’ 5241 | std::forward<BasicJsonType>(j).at(1).template get<A2>()}; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ In file included from /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/include/mock_rh_return_serialization.h:12, from /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/source/mock_rh.cpp:9: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21770:10: note: candidate: ‘template<class ValueTypeCV, class ValueType> constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = ValueTypeCV; ValueType = ValueType; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21770 | auto get() const noexcept( | ^~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21770:10: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp: In substitution of ‘template<class ValueTypeCV, class ValueType> constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<>::get<ValueTypeCV, ValueType>() const [with ValueTypeCV = BNE::RH::BusinessResultParameter; ValueType = BNE::RH::BusinessResultParameter]’: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5241:66: required from ‘std::pair<_Tp1, _Tp2> nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(BasicJsonType&&, nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<_Tp1, _Tp2> >, nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; A1 = const std::__cxx11::basic_string<char>; A2 = BNE::RH::BusinessResultParameter]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5271:32: required from ‘decltype (nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(forward<BasicJsonType>(j), forward<TupleRelated>(t), nlohmann::json_abi_v3_11_3::detail::priority_tag<3>{})) nlohmann::json_abi_v3_11_3::detail::from_json(BasicJsonType&&, TupleRelated&&) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; TupleRelated = nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >; decltype (nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(forward<BasicJsonType>(j), forward<TupleRelated>(t), nlohmann::json_abi_v3_11_3::detail::priority_tag<3>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5333:25: required from ‘decltype (nlohmann::json_abi_v3_11_3::detail::from_json(j, forward<T>(val))) nlohmann::json_abi_v3_11_3::detail::from_json_fn::operator()(const BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::json_abi_v3_11_3::basic_json<>; T = nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >; decltype (nlohmann::json_abi_v3_11_3::detail::from_json(j, forward<T>(val))) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:6139:37: required from ‘static decltype (nlohmann::json_abi_v3_11_3::from_json(forward<BasicJsonType>(j), nlohmann::json_abi_v3_11_3::detail::identity_tag<TargetType>{})) nlohmann::json_abi_v3_11_3::adl_serializer<T, SFINAE>::from_json(BasicJsonType&&) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; TargetType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; <template-parameter-1-2> = void; decltype (nlohmann::json_abi_v3_11_3::from_json(forward<BasicJsonType>(j), nlohmann::json_abi_v3_11_3::detail::identity_tag<TargetType>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21677:52: required from ‘ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<1>) const [with ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::has_non_default_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21779:35: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ] /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21636:45: required from ‘ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) const [with ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<(nlohmann::json_abi_v3_11_3::detail::is_default_constructible<ValueType>::value && nlohmann::json_abi_v3_11_3::detail::has_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21779:35: required from ‘constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void; decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t = nlohmann::json_abi_v3_11_3::basic_json<>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21925:30: required from ‘nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::operator ValueType() const [with ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::conjunction<nlohmann::json_abi_v3_11_3::detail::negation<std::is_pointer<_Ptr> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<_Up, std::nullptr_t> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, nlohmann::json_abi_v3_11_3::detail::json_ref<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass> > > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, typename StringType::value_type> >, nlohmann::json_abi_v3_11_3::detail::negation<nlohmann::json_abi_v3_11_3::detail::is_basic_json<BasicJsonType> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::initializer_list<typename StringType::value_type> > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::basic_string_view<char, std::char_traits<char> > > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::any> >, nlohmann::json_abi_v3_11_3::detail::is_detected_lazy<nlohmann::json_abi_v3_11_3::detail::get_template_function, const nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>&, ValueType> >::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /usr/include/c++/11/bits/unique_ptr.h:962:30: required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; _Args = {nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/common/json/json_serializer.h:44:39: required from ‘static std::unique_ptr<_Tp> JsonSerializer<T>::loadFromFile(const string&) [with T = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; std::string = std::__cxx11::basic_string<char>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/include/mock_rh_return_data.h:43:77: required from here /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21772:81: error: no matching function for call to ‘nlohmann::json_abi_v3_11_3::basic_json<>::get_impl<BNE::RH::BusinessResultParameter>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>) const’ 21772 | -> decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21632:15: note: candidate: ‘template<class ValueType, typename std::enable_if<(nlohmann::json_abi_v3_11_3::detail::is_default_constructible<T1>::value && nlohmann::json_abi_v3_11_3::detail::has_from_json<nlohmann::json_abi_v3_11_3::basic_json<>, ValueType, void>::value), int>::type <anonymous> > ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) const [with ValueType = ValueType; typename std::enable_if<(nlohmann::json_abi_v3_11_3::detail::is_default_constructible<ValueType>::value && nlohmann::json_abi_v3_11_3::detail::has_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value), int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21632 | ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept( | ^~~~~~~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21632:15: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21631:28: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ 21631 | int > = 0 > | ^ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21674:15: note: candidate: ‘template<class ValueType, typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::has_non_default_from_json<nlohmann::json_abi_v3_11_3::basic_json<>, ValueType, void>::value, int>::type <anonymous> > ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<1>) const [with ValueType = ValueType; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::has_non_default_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value, int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21674 | ValueType get_impl(detail::priority_tag<1> /*unused*/) const noexcept(noexcept( | ^~~~~~~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21674:15: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21673:28: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ 21673 | int > = 0 > | ^ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21699:19: note: candidate: ‘template<class BasicJsonType, typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::is_basic_json<BasicJsonType>::value, int>::type <anonymous> > BasicJsonType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<2>) const [with BasicJsonType = BasicJsonType; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::is_basic_json<BasicJsonType>::value, int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21699 | BasicJsonType get_impl(detail::priority_tag<2> /*unused*/) const | ^~~~~~~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21699:19: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21698:28: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ 21698 | int > = 0 > | ^ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21722:16: note: candidate: ‘template<class BasicJsonType, typename std::enable_if<std::is_same<BasicJsonType, nlohmann::json_abi_v3_11_3::basic_json<> >::value, int>::type <anonymous> > nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass> nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<3>) const [with BasicJsonType = BasicJsonType; typename std::enable_if<std::is_same<BasicJsonType, nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass> >::value, int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21722 | basic_json get_impl(detail::priority_tag<3> /*unused*/) const | ^~~~~~~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21722:16: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21721:25: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ 21721 | int> = 0> | ^ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21735:20: note: candidate: ‘template<class PointerType, typename std::enable_if<std::is_pointer<_Tp>::value, int>::type <anonymous> > constexpr decltype (declval<const basic_json_t&>().get_ptr<PointerType>()) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>) const [with PointerType = PointerType; typename std::enable_if<std::is_pointer<_Ptr>::value, int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21735 | constexpr auto get_impl(detail::priority_tag<4> /*unused*/) const noexcept | ^~~~~~~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21735:20: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21734:25: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ 21734 | int> = 0> | ^ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp: In instantiation of ‘std::pair<_Tp1, _Tp2> nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(BasicJsonType&&, nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<_Tp1, _Tp2> >, nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; A1 = const std::__cxx11::basic_string<char>; A2 = BNE::RH::BusinessResultParameter]’: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5271:32: required from ‘decltype (nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(forward<BasicJsonType>(j), forward<TupleRelated>(t), nlohmann::json_abi_v3_11_3::detail::priority_tag<3>{})) nlohmann::json_abi_v3_11_3::detail::from_json(BasicJsonType&&, TupleRelated&&) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; TupleRelated = nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >; decltype (nlohmann::json_abi_v3_11_3::detail::from_json_tuple_impl(forward<BasicJsonType>(j), forward<TupleRelated>(t), nlohmann::json_abi_v3_11_3::detail::priority_tag<3>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5333:25: required from ‘decltype (nlohmann::json_abi_v3_11_3::detail::from_json(j, forward<T>(val))) nlohmann::json_abi_v3_11_3::detail::from_json_fn::operator()(const BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::json_abi_v3_11_3::basic_json<>; T = nlohmann::json_abi_v3_11_3::detail::identity_tag<std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >; decltype (nlohmann::json_abi_v3_11_3::detail::from_json(j, forward<T>(val))) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:6139:37: required from ‘static decltype (nlohmann::json_abi_v3_11_3::from_json(forward<BasicJsonType>(j), nlohmann::json_abi_v3_11_3::detail::identity_tag<TargetType>{})) nlohmann::json_abi_v3_11_3::adl_serializer<T, SFINAE>::from_json(BasicJsonType&&) [with BasicJsonType = const nlohmann::json_abi_v3_11_3::basic_json<>&; TargetType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; <template-parameter-1-2> = void; decltype (nlohmann::json_abi_v3_11_3::from_json(forward<BasicJsonType>(j), nlohmann::json_abi_v3_11_3::detail::identity_tag<TargetType>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21677:52: required from ‘ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<1>) const [with ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::has_non_default_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21779:35: required from ‘constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void; decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) = std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t = nlohmann::json_abi_v3_11_3::basic_json<>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5099:75: [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ] /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21636:45: required from ‘ValueType nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get_impl(nlohmann::json_abi_v3_11_3::detail::priority_tag<0>) const [with ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<(nlohmann::json_abi_v3_11_3::detail::is_default_constructible<ValueType>::value && nlohmann::json_abi_v3_11_3::detail::has_from_json<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>, ValueType>::value), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21779:35: required from ‘constexpr decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void; decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t = nlohmann::json_abi_v3_11_3::basic_json<>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21925:30: required from ‘nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::operator ValueType() const [with ValueType = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; typename std::enable_if<nlohmann::json_abi_v3_11_3::detail::conjunction<nlohmann::json_abi_v3_11_3::detail::negation<std::is_pointer<_Ptr> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<_Up, std::nullptr_t> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, nlohmann::json_abi_v3_11_3::detail::json_ref<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass> > > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, typename StringType::value_type> >, nlohmann::json_abi_v3_11_3::detail::negation<nlohmann::json_abi_v3_11_3::detail::is_basic_json<BasicJsonType> >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::initializer_list<typename StringType::value_type> > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::basic_string_view<char, std::char_traits<char> > > >, nlohmann::json_abi_v3_11_3::detail::negation<std::is_same<ValueType, std::any> >, nlohmann::json_abi_v3_11_3::detail::is_detected_lazy<nlohmann::json_abi_v3_11_3::detail::get_template_function, const nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>&, ValueType> >::value, int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ /usr/include/c++/11/bits/unique_ptr.h:962:30: required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; _Args = {nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter> >]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/common/json/json_serializer.h:44:39: required from ‘static std::unique_ptr<_Tp> JsonSerializer<T>::loadFromFile(const string&) [with T = std::map<std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>; std::string = std::__cxx11::basic_string<char>]’ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/include/mock_rh_return_data.h:43:77: required from here /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21811:10: note: candidate: ‘template<class PointerType, typename std::enable_if<std::is_pointer<_Tp>::value, int>::type <anonymous> > decltype (declval<nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t&>().get_ptr<PointerType>()) nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() [with PointerType = PointerType; typename std::enable_if<std::is_pointer<_Ptr>::value, int>::type <anonymous> = <anonymous>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void]’ 21811 | auto get() noexcept -> decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>()) | ^~~ /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21811:10: note: template argument deduction/substitution failed: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:21810:68: error: no type named ‘type’ in ‘struct std::enable_if<false, int>’ 21810 | std::is_pointer<PointerType>::value, int>::type = 0> | ^ In file included from /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/include/mock_rh_return_serialization.h:12, from /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/mock/rh/source/mock_rh.cpp:9: /home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/extern/base_platform/Release/X86_64/Linux/thirdparty/json/include/nlohmann/json.hpp:5241:68: error: could not convert ‘{nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::get() const [with ValueTypeCV = const std::__cxx11::basic_string<char>; ValueType = std::__cxx11::basic_string<char>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::json_abi_v3_11_3::adl_serializer; BinaryType = std::vector<unsigned char>; CustomBaseClass = void; decltype (declval<const basic_json_t&>().get_impl<ValueType>(nlohmann::json_abi_v3_11_3::detail::priority_tag<4>{})) = std::__cxx11::basic_string<char>; nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::basic_json_t = nlohmann::json_abi_v3_11_3::basic_json<>](), <expression error>}’ from ‘<brace-enclosed initializer list>’ to ‘std::pair<const std::__cxx11::basic_string<char>, BNE::RH::BusinessResultParameter>’ 5241 | std::forward<BasicJsonType>(j).at(1).template get<A2>()}; | ^ | | | <brace-enclosed initializer list> gmake[3]: *** [mock/rh/CMakeFiles/MockRH.dir/build.make:79: mock/rh/CMakeFiles/MockRH.dir/source/mock_rh.cpp.o] Error 1 gmake[3]: Leaving directory '/home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/build/Release/X86_64/Linux' gmake[2]: *** [CMakeFiles/Makefile2:335: mock/rh/CMakeFiles/MockRH.dir/all] Error 2 gmake[2]: Leaving directory '/home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/build/Release/X86_64/Linux' gmake[1]: *** [Makefile:136: all] Error 2 gmake[1]: Leaving directory '/home/yushijin/fromGitLib/myWorkspace/server_sw_dev/server/build/Release/X86_64/Linux' make: *** [Makefile:32: build] Error 2
最新发布
01-08
当使用 `nlohmann/json` 库出现 `no matching function for call to ‘nlohmann::json_abi_v3_11_3::basic_json<>::get<BNE::RH::BusinessResultParameter>() const’` 这类编译错误时,通常是因为 `nlohmann/json` 库无法将 JSON 对象转换为指定的结构体类型,可能有以下几种原因及解决办法: #### 1. 未定义序列化和反序列化方法 如果没有为 `BNE::RH::BusinessResultParameter` 结构体定义合适的序列化和反序列化方法,`nlohmann/json` 库就不知道如何将 JSON 数据转换为该结构体。可以使用 `NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE` 宏来定义结构体与 JSON 的映射关系。 示例代码如下: ```cpp #include <nlohmann/json.hpp> #include <iostream> namespace BNE { namespace RH { // 假设 TaskType 定义如下 enum TaskType { TASK_INITIALIZE, // 其他枚举值... }; struct BusinessResultParameter { TaskType taskType; long long index; }; } } // 定义枚举类型与JSON的映射关系 NLOHMANN_JSON_SERIALIZE_ENUM(BNE::RH::TaskType, { {BNE::RH::TASK_INITIALIZE, "TASK_INITIALIZE"}, // 其他映射... }) // 使用 NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE 宏定义结构体与JSON的映射 NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(BNE::RH::BusinessResultParameter, taskType, index) int main() { std::string jsonStr = R"({"taskType": "TASK_INITIALIZE", "index": 123456})"; nlohmann::json json = nlohmann::json::parse(jsonStr); BNE::RH::BusinessResultParameter brp = json.get<BNE::RH::BusinessResultParameter>(); std::cout << "Task Type: " << static_cast<int>(brp.taskType) << ", Index: " << brp.index << std::endl; return 0; } ``` #### 2. 命名空间问题 如果 `BNE::RH::BusinessResultParameter` 定义在特定的命名空间中,要确保在使用 `get` 方法时指定了正确的命名空间。 #### 3. 头文件包含问题 要确保包含了 `nlohmann/json.hpp` 头文件,并且编译器能够找到该头文件。 #### 4. 版本兼容性问题 确保 `nlohmann/json` 库的版本与代码兼容。不同版本的库可能有细微的接口差异。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值