mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Provide useful and unambigous stringification for static arrays
This commit is contained in:
		| @@ -136,18 +136,6 @@ namespace Catch { | ||||
|         static std::string convert(wchar_t * str); | ||||
|     }; | ||||
|  | ||||
|     template<typename T> | ||||
|     struct is_string_array : std::false_type {}; | ||||
|  | ||||
|     template<std::size_t N> | ||||
|     struct is_string_array<char[N]> : std::true_type {}; | ||||
|  | ||||
|     template<std::size_t N> | ||||
|     struct is_string_array<signed char[N]> : std::true_type {}; | ||||
|  | ||||
|         template<std::size_t N> | ||||
|     struct is_string_array<unsigned char[N]> : std::true_type {}; | ||||
|  | ||||
|     template<int SZ> | ||||
|     struct StringMaker<char[SZ]> { | ||||
|         static std::string convert(const char* str) { | ||||
| @@ -399,12 +387,20 @@ namespace Catch { | ||||
|     } | ||||
|  | ||||
|     template<typename R> | ||||
|     struct StringMaker<R, typename std::enable_if<is_range<R>::value && !is_string_array<R>::value>::type> { | ||||
|     struct StringMaker<R, typename std::enable_if<is_range<R>::value && !std::is_array<R>::value>::type> { | ||||
|         static std::string convert( R const& range ) { | ||||
|             return rangeToString( range ); | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|     template <typename T, int SZ> | ||||
|     struct StringMaker<T[SZ]> { | ||||
|         static std::string convert(T const(&arr)[SZ]) { | ||||
|             return rangeToString(arr); | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| // Separate std::chrono::duration specialization | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský