4#ifndef TETL_MEMORY_CONSTRUCT_AT_HPP
5#define TETL_MEMORY_CONSTRUCT_AT_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_new/operator
.hpp>
10#include <etl/_type_traits/declval.hpp>
11#include <etl/_utility/forward.hpp>
13#if __has_include(<memory>)
24template <
typename T,
typename... Args,
typename =
decltype(::
new (etl::declval<
void*>()) T(etl::declval<Args>()...))>
25constexpr auto construct_at(T* p, Args&&... args) -> T*
27 return ::
new (
static_cast<
void*>(p)) T(etl::forward<Args>(args)...);
38template <
typename T,
typename... Args,
typename =
decltype(::
new (
etl::declval<void*>()) T(
etl::declval<Args>()...))>
41 return ::std::construct_at(p,
etl::forward<Args>(args)...);
Definition adjacent_find.hpp:9
auto declval() noexcept -> add_rvalue_reference_t< T >
constexpr auto construct_at(T *p, Args &&... args) -> T *
Creates a T object initialized with arguments args... at given address p.
Definition construct_at.hpp:39