Menu

#24 Compile error in std::pair serialization.

Unstable_(example)
open
nobody
None
1
2019-09-16
2019-09-16
Anonymous
No

The attached program json_pair.cpp fails to compile with lots of errors, including
/usr/local/include/cppcms/json.h:613:76: error: no matching function for call to 'cppcms::json::value::ge
t_value(const char [6]) const'
std::pair<t1,t2> pair(v.get_value<t1>("first"),v.get_value<t2>("second"));
and
/usr/local/include/cppcms/json.h:619:4: error: no matching function for call to 'cppcms::json::value::set
_value(const char [6], const int&)'
v.set_value("first",in.first);</t2></t1></t1,t2>

It can be fixed changing [g|s]et_value with [g|s]set in cppcms::json::traits< std::pair<T1,T2> >, like in the diff file.
2 Attachments

Discussion

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.