Reorganised C+11 feature detection a bit

and added CATCH_CONFIG_CPP11_NULLPTR for VS2015
This commit is contained in:
Phil Nash
2015-05-19 18:37:58 +01:00
parent bfa3f863d6
commit e86daf8bdd
9 changed files with 76 additions and 45 deletions

View File

@@ -21,8 +21,11 @@
#include "catch_objc_arc.hpp"
#endif
#ifdef CATCH_CPP11_OR_GREATER
#ifdef CATCH_CONFIG_CPP11_TUPLE
#include <tuple>
#endif
#ifdef CATCH_CONFIG_CPP11_IS_ENUM
#include <type_traits>
#endif
@@ -105,7 +108,7 @@ namespace Detail {
#endif
#if defined(CATCH_CPP11_OR_GREATER)
#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
template<typename T,
bool IsEnum = std::is_enum<T>::value
>
@@ -127,7 +130,7 @@ namespace Detail {
#endif
template<bool C>
struct StringMakerBase {
#if defined(CATCH_CPP11_OR_GREATER)
#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
template<typename T>
static std::string convert( T const& v )
{
@@ -201,7 +204,7 @@ std::string toString( std::vector<T,Allocator> const& v ) {
}
#ifdef CATCH_CPP11_OR_GREATER
#ifdef CATCH_CONFIG_CPP11_TUPLE
// toString for tuples
namespace TupleDetail {
@@ -241,7 +244,7 @@ struct StringMaker<std::tuple<Types...>> {
return os.str();
}
};
#endif
#endif // CATCH_CONFIG_CPP11_TUPLE
namespace Detail {
template<typename T>