Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-10-27 19:49:46 +0200
committerMartin Hořeňovský2021-10-27 20:01:13 +0200
commitf17725a186d209a26836fc3e13cdcee423ddd1e8 (patch)
tree064ae842d7baa9da077a32b28ff2eb627b3a21d3 /src/catch2
parentec2d5013fbeddd30e65c44639287b15eb591d68e (diff)
downloadcatch3-f17725a186d209a26836fc3e13cdcee423ddd1e8.tar.gz
Split void_type into its own header and rename it to void_t
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/catch_all.hpp1
-rw-r--r--src/catch2/catch_tostring.hpp12
-rw-r--r--src/catch2/internal/catch_void_type.hpp25
3 files changed, 29 insertions, 9 deletions
diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp
index 742d89a9..e111756a 100644
--- a/src/catch2/catch_all.hpp
+++ b/src/catch2/catch_all.hpp
@@ -106,6 +106,7 @@
#include <catch2/internal/catch_uncaught_exceptions.hpp>
#include <catch2/internal/catch_unique_name.hpp>
#include <catch2/internal/catch_unique_ptr.hpp>
+#include <catch2/internal/catch_void_type.hpp>
#include <catch2/internal/catch_wildcard_pattern.hpp>
#include <catch2/internal/catch_windows_h_proxy.hpp>
#include <catch2/internal/catch_xmlwriter.hpp>
diff --git a/src/catch2/catch_tostring.hpp b/src/catch2/catch_tostring.hpp
index 2fd613d3..0bbf989c 100644
--- a/src/catch2/catch_tostring.hpp
+++ b/src/catch2/catch_tostring.hpp
@@ -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>
diff --git a/src/catch2/internal/catch_void_type.hpp b/src/catch2/internal/catch_void_type.hpp
new file mode 100644
index 00000000..23875c35
--- /dev/null
+++ b/src/catch2/internal/catch_void_type.hpp
@@ -0,0 +1,25 @@
+
+// Copyright Catch2 Authors
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// https://www.boost.org/LICENSE_1_0.txt)
+
+// SPDX-License-Identifier: BSL-1.0
+#ifndef CATCH_VOID_TYPE_HPP_INCLUDED
+#define CATCH_VOID_TYPE_HPP_INCLUDED
+
+
+namespace Catch {
+ namespace Detail {
+
+ template <typename...>
+ struct make_void { using type = void; };
+
+ template <typename... Ts>
+ using void_t = typename make_void<Ts...>::type;
+
+ } // namespace Detail
+} // namespace Catch
+
+
+#endif // CATCH_VOID_TYPE_HPP_INCLUDED