You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@nlohmann@theodelrieu
Hi, variant is not support in Release 3.6.1? Have any Variant examples?
I test the example that it's not success in Release 3.6.1.
Handling std::variant has been discussed extensively in #1261, there is a complete code example that shows how to support it in a generic manner (however not optimal).
You can find the reason why we chose to not add it in the library here.
@nlohmann @theodelrieu
Hi, variant is not support in Release 3.6.1? Have any Variant examples?
I test the example that it's not success in Release 3.6.1.
variant.cpp: In function ‘int main()’: variant.cpp:17:31: error: no matching function for call to ‘nlohmann::basic_json<>::basic_json(std::variant<int, float>&)’ std::cout << nlohmann::json(t).dump() << std::endl; ^ In file included from variant.cpp:3:0: /nlohmann/json.hpp:1841:5: note: candidate: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::basic_json(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>&&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer] basic_json(basic_json&& other) noexcept
The text was updated successfully, but these errors were encountered: