Author
anonymous
almost 7 years ago
Language
C++
Compiler
gcc 9.1.0
Options
Don't Use Boost
C++17
no pedantic
Author
anonymous
almost 7 years ago
$ g++ prog.cc -std=c++17 In file included from prog.cc:1:
json.hpp: In instantiation of 'ValueType nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::get() const [with ValueTypeCV = const dummy::foo; ValueType = dummy::foo; typename std::enable_if<((! std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>, ValueType>::value) && nlohmann::detail::has_non_default_from_json<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>, 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::adl_serializer]':
json.hpp:15635:20: recursively required by substitution of 'template<class Default, template<class ...> class Op, class ... Args> struct nlohmann::detail::detector<Default, typename nlohmann::detail::make_void<Op<Args ...> >::type, Op, Args ...> [with Default = nlohmann::detail::nonesuch; Op = nlohmann::detail::get_template_function; Args = {const nlohmann::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::adl_serializer>&, const dummy::foo}]'
json.hpp:15635:20: required by substitution of 'template<class ValueType, typename std::enable_if<(((((((! std::is_pointer<_Tp>::value) && (! std::is_same<ValueType, nlohmann::detail::json_ref<nlohmann::basic_json<> > >::value)) && (! std::is_same<ValueType, char>::value)) && (! nlohmann::detail::is_basic_json<BasicJsonType>::value)) && (! std::is_same<ValueType, std::initializer_list<char> >::value)) && (! std::is_same<ValueType, std::basic_string_view<char> >::value)) && typename nlohmann::detail::detector<nlohmann::detail::nonesuch, void, nlohmann::detail::get_template_function, const nlohmann::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::adl_serializer>&, ValueType>::value_t::value), int>::type <anonymous> > nlohmann::basic_json<>::operator ValueType<ValueType, <enumerator> >() const [with ValueType = const dummy::foo; typename std::enable_if<(((((((! std::is_pointer<_Tp>::value) && (! std::is_same<ValueType, nlohmann::detail::json_ref<nlohmann::basic_json<> > >::value)) && (! std::is_same<ValueType, char>::value)) && (! nlohmann::detail::is_basic_json<BasicJsonType>::value)) && (! std::is_same<ValueType, std::initializer_list<char> >::value)) && (! std::is_same<ValueType, std::basic_string_view<char> >::value)) && typename nlohmann::detail::detector<nlohmann::detail::nonesuch, void, nlohmann::detail::get_template_function, const nlohmann::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::adl_serializer>&, ValueType>::value_t::value), int>::type <anonymous> = <missing>]'
prog.cc:19:3: required from 'void dummy::from_json(const BasicJsonType&, dummy::fruit&) [with BasicJsonType = nlohmann::basic_json<>]'
json.hpp:1629:25: required from 'decltype ((nlohmann::detail::from_json(j, val), void())) nlohmann::detail::from_json_fn::operator()(const BasicJsonType&, T&) const [with BasicJsonType = nlohmann::basic_json<>; T = dummy::fruit; decltype ((nlohmann::detail::from_json(j, val), void())) = void]'
json.hpp:2186:30: required from 'static decltype ((nlohmann::{anonymous}::from_json(forward<BasicJsonType>(j), val), void())) nlohmann::adl_serializer<T, SFINAE>::from_json(BasicJsonType&&, ValueType&) [with BasicJsonType = const nlohmann::basic_json<>&; ValueType = dummy::fruit; <template-parameter-1-1> = dummy::fruit; <template-parameter-1-2> = void; decltype ((nlohmann::{anonymous}::from_json(forward<BasicJsonType>(j), val), void())) = void]'
json.hpp:15360:45: required from 'ValueType nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::get() const [with ValueTypeCV = dummy::fruit; ValueType = dummy::fruit; typename std::enable_if<(((! nlohmann::detail::is_basic_json<U>::value) && nlohmann::detail::has_from_json<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>, ValueType>::value) && (! nlohmann::detail::has_non_default_from_json<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>, 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::adl_serializer]'
prog.cc:25:56: required from here
json.hpp:15400:78: error: no matching function for call to 'nlohmann::adl_serializer<const dummy::foo, void>::from_json(const nlohmann::basic_json<>&)'
15400 | JSONSerializer<ValueTypeCV>::from_json(std::declval<const basic_json_t&>())))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from prog.cc:1:
json.hpp:2182:17: note: candidate: 'template<class BasicJsonType, class ValueType> static decltype ((nlohmann::{anonymous}::from_json(forward<BasicJsonType>(j), val), void())) nlohmann::adl_serializer<T, SFINAE>::from_json(BasicJsonType&&, ValueType&) [with BasicJsonType = BasicJsonType; ValueType = ValueType; <template-parameter-1-1> = const dummy::foo; <template-parameter-1-2> = void]'
2182 | static auto from_json(BasicJsonType&& j, ValueType& val) noexcept(
| ^~~~~~~~~
json.hpp:2182:17: note: template argument deduction/substitution failed:
In file included from prog.cc:1:
json.hpp:15400:78: note: candidate expects 2 arguments, 1 provided
15400 | JSONSerializer<ValueTypeCV>::from_json(std::declval<const basic_json_t&>())))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
json.hpp:18328:17: warning: inline function 'bool nlohmann::operator==(nlohmann::basic_json<>::const_reference, nlohmann::basic_json<>::const_reference)' used but never defined
18328 | friend bool operator==(const_reference lhs, const_reference rhs) noexcept
| ^~~~~~~~
In file included from /opt/wandbox/gcc-9.1.0/include/c++/9.1.0/algorithm:62,
from json.hpp:37,
from prog.cc:1:
/opt/wandbox/gcc-9.1.0/include/c++/9.1.0/bits/stl_algo.h:3905:5: error: '_IIter std::find_if(_IIter, _IIter, _Predicate) [with _IIter = const std::pair<dummy::fruit, nlohmann::basic_json<> >*; _Predicate = dummy::from_json(const BasicJsonType&, dummy::fruit&) [with BasicJsonType = nlohmann::basic_json<>]::<lambda(const std::pair<dummy::fruit, nlohmann::basic_json<> >&)>]', declared using local type 'dummy::from_json(const BasicJsonType&, dummy::fruit&) [with BasicJsonType = nlohmann::basic_json<>]::<lambda(const std::pair<dummy::fruit, nlohmann::basic_json<> >&)>', is used but never defined [-fpermissive]
3905 | find_if(_InputIterator __first, _InputIterator __last,
| ^~~~~~~
Exit Code:
1