GenericValue: add static assert to catch broken SFINAE
Before applying the simplifications in ed282b814, 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.
This commit is contained in:
parent
fdd7a76386
commit
804b7fcb2f
@ -458,7 +458,10 @@ public:
|
|||||||
#else
|
#else
|
||||||
explicit GenericValue(bool b)
|
explicit GenericValue(bool b)
|
||||||
#endif
|
#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.
|
//! Constructor for int value.
|
||||||
explicit GenericValue(int i) : data_(), flags_(kNumberIntFlag) {
|
explicit GenericValue(int i) : data_(), flags_(kNumberIntFlag) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user