halcheck 1.0
Loading...
Searching...
No Matches
memory.hpp
1#ifndef HALCHECK_LIB_MEMORY_HPP
2#define HALCHECK_LIB_MEMORY_HPP
3
11#include <halcheck/lib/type_traits.hpp>
12
13#include <memory> // IWYU pragma: export
14#include <type_traits>
15
16namespace halcheck { namespace lib {
17
22template<typename T, typename... Args, HALCHECK_REQUIRE(!std::is_array<T>())>
24 return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
25}
26
27}} // namespace halcheck::lib
28
29#endif
T forward(T... args)
#define HALCHECK_REQUIRE(...)
Expands to a template argument that is only valid if the given argument evaluates to true.
Definition type_traits.hpp:24
std::unique_ptr< T > make_unique(Args... args)
An implementation of std::make_unique.
Definition memory.hpp:23