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
JSONCONS_N_MEMBER_NAME_TRAITS produces compile error. It also does not have any test coverage.
JSONCONS_ALL_MEMBER_NAME_TRAITS works fine.
struct Person {
std::string name;
std::string surname;
};
JSONCONS_N_MEMBER_NAME_TRAITS(Person, 1, (name, "n"), (surname, "sn"))
int main() {
std::string data = R"({"n":"Rod"})";
auto person = jsoncons::decode_json<Person>(data);
std::string s;
jsoncons::encode_json_pretty(person, s);
std::cout << s << "\n";
}
FAILED:
jsoncons-0.155.0/include/jsoncons/json_traits_macros.hpp:307:114: error: ‘name_str’ is not a member of ‘jsoncons::json_traits_macro_names<char, Person>’
{json_traits_helper<Json>::set_optional_json_member(json_traits_macro_names<char_type,value_type>::Member##_str(char_type{}), aval.Member, ajson);}
Compiler: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
Architecture: x86_64
Operating system: Ubuntu 18.04
**What jsoncons library version
0.155.0
The text was updated successfully, but these errors were encountered:
JSONCONS_N_MEMBER_NAME_TRAITS produces compile error. It also does not have any test coverage.
JSONCONS_ALL_MEMBER_NAME_TRAITS works fine.
FAILED:
**What jsoncons library version
0.155.0
The text was updated successfully, but these errors were encountered: