CBMC
constructor_of.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: constructor_of
4 
5 Author: Diffblue Ltd.
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_UTIL_CONSTRUCTOR_OF_H
10 #define CPROVER_UTIL_CONSTRUCTOR_OF_H
11 
12 #include <utility>
13 
16 template <typename constructedt>
17 class constructor_oft final
18 {
19 public:
20  template <typename... argumentst>
21  constructedt operator()(argumentst &&... arguments)
22  {
23  return constructedt{std::forward<argumentst>(arguments)...};
24  }
25 };
26 
29 template <typename constructedt>
31 {
32  return {};
33 }
34 
35 #endif // CPROVER_UTIL_CONSTRUCTOR_OF_H
A type of functor which wraps around the set of constructors of a type.
constructedt operator()(argumentst &&... arguments)
constexpr constructor_oft< constructedt > constructor_of()
Returns a functor which constructs type constructedt.