Commit 804b7fcb authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

GenericValue: add static assert to catch broken SFINAE

Before applying the simplifications in ed282b81, the SFINAE check for the
GenericValue(bool) constructor has been broken in MSVC 2005. Add a static
assert as a safe-guard against future reappearance of this problem.
parent fdd7a763
......@@ -458,7 +458,10 @@ public:
#else
explicit GenericValue(bool b)
#endif
: data_(), flags_(b ? kTrueFlag : kFalseFlag) {}
: data_(), flags_(b ? kTrueFlag : kFalseFlag) {
// safe-guard against failing SFINAE
RAPIDJSON_STATIC_ASSERT((internal::IsSame<bool,T>::Value));
}
//! Constructor for int value.
explicit GenericValue(int i) : data_(), flags_(kNumberIntFlag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment