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).
This commit is contained in:
Martchus 2018-11-01 04:51:38 +00:00
parent 7e649fe2bf
commit 712eb4fb28
1 changed files with 5 additions and 3 deletions

View File

@ -3,18 +3,20 @@
#include <list>
#include <vector>
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<vector<int>>::value, "vector mapped to array");