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
I added the following lines of code to my current project:
#include <nlohmann/json.hpp>
using json = nlohmann::json;
// ...
void Model::initJSONData(json::json &json_data, std::string path_to_file)
{
std::ifstream json_file_stream(path_to_file.c_str());
if(!json_file_stream.is_open())
throw std::runtime_error("JSON file DTModelDatabase.json could not be opened.");
json_file_stream >> json_data;
json_file_stream.close();
}
However, I get the following error:
".../include/json/include/nlohmann/detail/iterators/iteration_proxy.hpp", line 151: error:
"tuple_size" has already been declared in the current scope
class tuple_size<::nlohmann::detail::iteration_proxy_value<IteratorType>>
^
As can be seen, the error originates from the header-file iteration_proxy.hpp. Is it possible that there is a conflict with the already defined tuple_size in std? I run a Red Hat Enterprise Linux with GCC 6.3.0 (c++11 is set). Can anybody help me out with this error?
The text was updated successfully, but these errors were encountered:
Thanks for testing my code snippet. I tested the project I am working on now for different versions of this JSON library, producing even other errors like:
"/home/ceres_ns_scratch5/nxf36874/TAG180628_AHB/ss_solver_new_json/include/json/include/nlohmann/detail/conversions/to_json.hpp", line 301: error:
too few arguments for class template "std::pair"
void to_json(BasicJsonType& j, const std::pair<Args...>& p)
^
Thus, as you stated as well, the error is most probably not due to the library or due to the way I use it, but somewhere else in the project.
I added the following lines of code to my current project:
However, I get the following error:
As can be seen, the error originates from the header-file iteration_proxy.hpp. Is it possible that there is a conflict with the already defined tuple_size in std? I run a Red Hat Enterprise Linux with GCC 6.3.0 (c++11 is set). Can anybody help me out with this error?
The text was updated successfully, but these errors were encountered: