VCCC  2024.05
VisualCamp Common C++ library
is_complete.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2023-12-03.
3 //
4 
5 #ifndef VCCC_TYPE_TRAITS_IS_COMPLETE_HPP_
6 #define VCCC_TYPE_TRAITS_IS_COMPLETE_HPP_
7 
8 #include <cstddef>
9 #include <type_traits>
10 
11 namespace vccc {
12 namespace detail {
13 template <class T, std::size_t = sizeof(T)>
14 std::true_type is_complete_impl(T *);
15 
16 std::false_type is_complete_impl(...);
17 } // namespace detail
18 
21 
22 template <class T>
23 using is_complete = decltype(detail::is_complete_impl(std::declval<T*>()));
24 
26 
27 } // namespace vccc
28 
29 #endif // VCCC_TYPE_TRAITS_IS_COMPLETE_HPP_
decltype(detail::is_complete_impl(std::declval< T * >())) is_complete
Definition: is_complete.hpp:23
Definition: directory.h:12