tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
ranges_construct_at.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2024 Tobias Hienzsch
3
4#ifndef TETL_MEMORY_RANGES_CONSTRUCT_AT_HPP
5#define TETL_MEMORY_RANGES_CONSTRUCT_AT_HPP
6
7#include <etl/_memory/construct_at.hpp>
8#include <etl/_utility/forward.hpp>
9
10namespace etl::ranges {
11
12inline constexpr struct construct_at_fn {
13 template <typename T, typename... Args>
14 requires requires(void* ptr, Args&&... args) { ::new (ptr) T(etl::forward<Args>(args)...); }
15 constexpr auto operator()(T* p, Args&&... args) const -> T*
16 {
17 return etl::construct_at(p, etl::forward<Args>(args)...);
18 }
19} construct_at;
20
21} // namespace etl::ranges
22
23#endif // TETL_MEMORY_RANGES_CONSTRUCT_AT_HPP
Definition ranges_in_fun_result.hpp:12
Definition adjacent_find.hpp:9
Definition ranges_construct_at.hpp:12
constexpr auto operator()(T *p, Args &&... args) const -> T *
Definition ranges_construct_at.hpp:15