VCCC  2024.05
VisualCamp Common C++ library
destroy_at.hpp
Go to the documentation of this file.
1 //
2 // Created by YongGyu Lee on 3/20/24.
3 //
4 
5 #ifndef VCCC_MEMORY_DESTROY_AT_HPP_
6 #define VCCC_MEMORY_DESTROY_AT_HPP_
7 
8 #include <type_traits>
9 
12 
13 namespace vccc {
14 
17  p->~T();
18 }
19 
22  auto first = std::begin(*p);
23  auto last = std::end(*p);
24 
25  for (; first != last; ++first) {
27  }
28 }
29 
30 } // namespace vccc
31 
32 #endif // VCCC_MEMORY_DESTROY_AT_HPP_
#define VCCC_CONSTEXPR_AFTER_CXX20
Definition: constexpr.hpp:26
std::enable_if_t< std::is_object< T >::value, T * > addressof(T &t) noexcept
Definition: addressof.hpp:33
constexpr VCCC_INLINE_OR_STATIC detail::begin_niebloid begin
returns an iterator to the beginning of a range
Definition: begin.hpp:116
constexpr VCCC_INLINE_OR_STATIC detail::end_niebloid end
returns a sentinel indicating the end of a range
Definition: end.hpp:120
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 0 > first
Definition: key_value.hpp:34
VCCC_CONSTEXPR_AFTER_CXX20 void destroy_at(T *p)
Definition: destroy_at.hpp:16
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35