fixed nvp macro

This commit is contained in:
Shane Grant
2013-06-12 14:54:03 -07:00
parent 679caf17ba
commit aeeb326477
2 changed files with 2 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ namespace cereal
}
//! Creates a name value pair for the variable T, using the same name
#define CEREAL_NVP(T) make_nvp("T", T);
#define CEREAL_NVP(T) ::cereal::make_nvp(#T, T);
class BinaryOutputArchive
{

View File

@@ -84,7 +84,7 @@ int main()
int x = 5;
auto nvp = cereal::make_nvp("hello!", x);
//auto nvp2 = CEREAL_NVP(x);
archive & CEREAL_NVP(x);
std::cout << std::is_base_of<cereal::detail::NameValuePairCore, decltype(nvp)>::value << std::endl;
std::cout << cereal::traits::has_non_member_serialize<decltype(nvp), cereal::BinaryOutputArchive>() << std::endl;