tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
destroy.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_MEMORY_DESTROY_HPP
5#define TETL_MEMORY_DESTROY_HPP
6
7#include <etl/_memory/addressof.hpp>
8#include <etl/_memory/destroy_at.hpp>
9
10namespace etl {
11
12/// \brief Destroys the objects in the range [first, last).
13template <typename ForwardIt>
14constexpr auto destroy(ForwardIt first, ForwardIt last) -> void
15{
16 for (; first != last; ++first) {
17 etl::destroy_at(etl::addressof(*first));
18 }
19}
20
21} // namespace etl
22
23#endif // TETL_MEMORY_DESTROY_HPP
Definition adjacent_find.hpp:9
constexpr auto destroy(ForwardIt first, ForwardIt last) -> void
Destroys the objects in the range [first, last).
Definition destroy.hpp:14