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
When trying to compile simple program using devel branch:
#include"json.hpp"// for convenienceusing json = nlohmann::json;
intmain() {
// create an empty structure (null)
json j;
// add a number that is stored as double (note the implicit conversion of j to an object)
j["pi"] = 3.141;
return0;
}
following error is produced:
In file included from test.cpp:1:0:
json.hpp: In constructor ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::basic_json() [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]’:
json.hpp:1060:5: error: conversion from ‘nlohmann::basic_json<>::value_t’ to non-scalar type ‘nlohmann::basic_json<>::type_data_t’ requested
basic_json() = default;
^
test.cpp: In function ‘int main()’:
test.cpp:8:10: note: synthesized method ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::basic_json() [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]’ first required here
json j;
^
Compiler version:
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Compile command:
g++ test.cpp -std=c++11
The text was updated successfully, but these errors were encountered:
When trying to compile simple program using
devel
branch:following error is produced:
Compiler version:
Compile command:
The text was updated successfully, but these errors were encountered: