1#ifndef MSTL_CORE_MEMORY_CONSTRUCT_HPP__
2#define MSTL_CORE_MEMORY_CONSTRUCT_HPP__
32template <
typename T,
typename... Args>
33MSTL_CONSTEXPR20
enable_if_t<is_constructible_v<T, Args...>,
void*>
35noexcept(is_nothrow_constructible_v<T, Args...>) {
48noexcept(is_nothrow_destructible_v<T>) {
63MSTL_CONSTEXPR20
void destroy(Iterator first, Iterator last)
64noexcept(is_nothrow_destructible_v<iter_value_t<Iterator>>) {
79MSTL_CONSTEXPR20
void destroy(Iterator first, Iterator last)
noexcept {}
MSTL_NODISCARD constexpr T && forward(remove_reference_t< T > &x) noexcept
完美转发左值
MSTL_CONSTEXPR20 enable_if_t< is_constructible_v< T, Args... >, void * > construct(T *ptr, Args &&... args) noexcept(is_nothrow_constructible_v< T, Args... >)
在指定内存位置构造对象
MSTL_CONSTEXPR20 void destroy(T *pointer) noexcept(is_nothrow_destructible_v< T >)
销毁单个对象
MSTL_INLINE17 constexpr bool is_iter_v
检查类型是否为迭代器
#define _MSTL
全局命名空间MSTL前缀
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
typename enable_if< Test, T >::type enable_if_t
enable_if的便捷别名