Split void_type into its own header and rename it to void_t

This commit is contained in:
Martin Hořeňovský 2021-10-27 19:49:46 +02:00
parent ec2d5013fb
commit f17725a186
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
4 changed files with 30 additions and 9 deletions

View file

@ -14,9 +14,11 @@
#include <type_traits>
#include <string>
#include <string.h>
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <catch2/internal/catch_config_wchar.hpp>
#include <catch2/internal/catch_stream.hpp>
#include <catch2/internal/catch_void_type.hpp>
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
@ -474,19 +476,11 @@ namespace Catch {
using std::end;
namespace Detail {
template <typename...>
struct void_type {
using type = void;
};
template <typename... Ts>
using void_type_t = typename void_type<Ts...>::type;
template <typename T, typename = void>
struct is_range_impl : std::false_type {};
template <typename T>
struct is_range_impl<T, void_type_t<decltype(begin(std::declval<T>()))>> : std::true_type {};
struct is_range_impl<T, void_t<decltype(begin(std::declval<T>()))>> : std::true_type {};
} // namespace Detail
template <typename T>