halcheck
1.0
Loading...
Searching...
No Matches
include
halcheck
lib
functional
constructor.hpp
1
#ifndef HALCHECK_LIB_FUNCTIONAL_CONSTRUCTOR_HPP
2
#define HALCHECK_LIB_FUNCTIONAL_CONSTRUCTOR_HPP
3
4
// IWYU pragma: private, include <halcheck/lib/functional.hpp>
5
6
#include <halcheck/lib/type_traits.hpp>
7
8
namespace
halcheck {
namespace
lib {
9
15
template
<
typename
T>
16
struct
constructor
{
24
template
<
typename
... Args,
HALCHECK_REQUIRE
(
std::is_constructible<T, Args...>
())>
25
T
operator()
(Args... args) {
26
return
T(
std::forward<Args>
(args)...);
27
}
28
};
29
30
}}
// namespace halcheck::lib
31
32
#endif
std::forward
T forward(T... args)
HALCHECK_REQUIRE
#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::is_constructible
halcheck::lib::constructor::operator()
T operator()(Args... args)
Invokes a constructor of T.
Definition
constructor.hpp:25
halcheck::lib::constructor
A function object that calls the constructor of a given type.
Definition
constructor.hpp:16
Generated by
1.12.0