From 712eb4fb2870a07b184f71296e87cc8ac5b121f4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 1 Nov 2018 04:51:38 +0000 Subject: [PATCH] Fix compiling with GCC Template specializations produced by the macros apparently must be in the same namespace for GCC (not sure whether this is actually enforced by the standard). --- lib/tests/traits.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/tests/traits.cpp b/lib/tests/traits.cpp index 97a7bdb..f996cc8 100644 --- a/lib/tests/traits.cpp +++ b/lib/tests/traits.cpp @@ -3,18 +3,20 @@ #include #include -using namespace std; -using namespace ReflectiveRapidJSON; - // treat some types differently to test Treat... traits struct Foo { }; struct Bar { }; +namespace ReflectiveRapidJSON { REFLECTIVE_RAPIDJSON_TREAT_AS_MAP_OR_HASH(Foo); REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_MAP_OR_HASH(Foo); REFLECTIVE_RAPIDJSON_TREAT_AS_SET(Bar); REFLECTIVE_RAPIDJSON_TREAT_AS_MULTI_SET(Foo); +} // namespace ReflectiveRapidJSON + +using namespace std; +using namespace ReflectiveRapidJSON; // test traits static_assert(IsArray>::value, "vector mapped to array");