mirror of
https://github.com/USCiLab/cereal.git
synced 2025-10-18 01:45:52 +02:00
fixed nvp macro
This commit is contained in:
@@ -29,7 +29,7 @@ namespace cereal
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Creates a name value pair for the variable T, using the same name
|
//! 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
|
class BinaryOutputArchive
|
||||||
{
|
{
|
||||||
|
|||||||
2
test.cpp
2
test.cpp
@@ -84,7 +84,7 @@ int main()
|
|||||||
|
|
||||||
int x = 5;
|
int x = 5;
|
||||||
auto nvp = cereal::make_nvp("hello!", x);
|
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 << 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;
|
std::cout << cereal::traits::has_non_member_serialize<decltype(nvp), cereal::BinaryOutputArchive>() << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user