My Project
is_destructible.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_IS_DESTRUCTIBLE_HPP
29 #define BSL_IS_DESTRUCTIBLE_HPP
30 
31 #include "bool_constant.hpp"
32 #include "declval.hpp"
33 #include "is_detected.hpp"
34 #include "is_function.hpp"
35 #include "is_reference.hpp"
36 #include "is_scalar.hpp"
37 #include "is_unbounded_array.hpp"
38 #include "is_void.hpp"
39 #include "remove_all_extents.hpp"
40 
41 namespace bsl
42 {
43  namespace details
44  {
46  template<typename T>
47  using is_destructible_type = decltype(bsl::declval<T &>().~T());
48 
58  template<typename T>
59  [[nodiscard]] constexpr bool
61  {
63  return true;
64  }
65 
67  return false;
68  }
69 
71  }
72  }
73 
85  template<typename T>
86  class is_destructible final : // --
87  public bool_constant<details::check_is_destructible<T>()>
88  {};
89 }
90 
91 #endif
If the provided type is destructible, provides the member constant value equal to true....
Definition: is_destructible.hpp:86
decltype(bsl::declval< T & >().~T()) is_destructible_type
used to detect the presence of a destructor in T
Definition: is_destructible.hpp:47
If the provided type is a reference type (taking into account const qualifications),...
Definition: is_reference.hpp:48
If the provided type is a void type (taking into account const qualifications), provides the member c...
Definition: is_void.hpp:48
If the provided type is an array type (taking into account const qualifications), provides the member...
Definition: integral_constant.hpp:45
If the provided type is a function type, provides the member constant value equal to true....
Definition: is_function.hpp:49
If the provided type is an unbounded array, provides the member constant value equal to true....
Definition: is_unbounded_array.hpp:49
typename details::detector< nonesuch, void, Op, Args... >::value_t is_detected
The alias template is_detected is equivalent to typename detected_or<bsl::nonesuch,...
Definition: is_detected.hpp:42
constexpr bool check_is_destructible() noexcept
Checks if a type "T" is destructible and if so, returns true, otherwise returns false.
Definition: is_destructible.hpp:60