CBMC
type_traits.h
Go to the documentation of this file.
1 // Author: Diffblue Ltd.
2 
7 
8 #ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_TYPE_TRAITS_H
9 #define CPROVER_SOLVERS_SMT2_INCREMENTAL_TYPE_TRAITS_H
10 
11 #include <type_traits>
12 
13 namespace detail // NOLINT
14 {
15 // Implementation detail of `void_t`.
16 template <typename... typest>
17 struct make_voidt
18 {
19  using type = void;
20 };
21 } // namespace detail
22 
23 // The below definition is of a back-ported version of the C++17 STL
24 // `std::void_t` template. This makes this particular template available when
25 // compiling for the C++11 or C++14 standard versions. It will also compile
26 // as-is when targeting the C++17 standard. The back-ported version is not added
27 // to the `std` namespace as this would be undefined behaviour. However once we
28 // permanently move to the new standard the below code should be removed
29 // and `std::void_t` should be used directly, to avoid polluting the global
30 // namespace. For example -
31 // `void_t<decltype(foo.bar())>`
32 // should be updated to -
33 // `std::void_t<decltype(foo.bar())>`
34 template <typename... typest>
35 using void_t = typename detail::make_voidt<typest...>::type;
36 
37 #endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_TYPE_TRAITS_H
typename detail::make_voidt< typest... >::type void_t
Definition: type_traits.h:35