Skip to content

Commit

Permalink
Fix compiling with GCC
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Martchus committed Nov 1, 2018
1 parent 7e649fe commit 712eb4f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tests/traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 712eb4f

Please sign in to comment.