Iros
 
Loading...
Searching...
No Matches
destroy_at.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/meta/language.h"
5#include "di/meta/trivial.h"
6#include "di/util/addressof.h"
7
8namespace di::util {
9namespace detail {
11 template<concepts::Destructible T>
12 constexpr void operator()(T* pointer) const {
13 if constexpr (concepts::LanguageArray<T>) {
14 for (auto& item : *pointer) {
15 (*this)(util::addressof(item));
16 }
17 } else if constexpr (!concepts::TriviallyDestructible<T>) {
18 pointer->~T();
19 }
20 }
21 };
22}
23
24constexpr inline auto destroy_at = detail::DestroyAtFunction {};
25}
26
27namespace di {
29}
Definition language.h:110
Definition clamp.h:9
Definition vocab.h:96
constexpr auto destroy_at
Definition destroy_at.h:24
Definition zstring_parser.h:9
Definition destroy_at.h:10
constexpr void operator()(T *pointer) const
Definition destroy_at.h:12