Rice  3.0.0
Constructor.hpp
1 #ifndef Rice__Constructor__hpp_
2 #define Rice__Constructor__hpp_
3 
4 // This causes problems with certain C++ libraries
5 #undef TYPE
6 
7 #include "to_from_ruby_defn.hpp"
8 
9 namespace Rice
10 {
12 
24  template<typename T, typename ...Arg_T>
26  {
27  public:
28  static void construct(Object self, Arg_T... args)
29  {
30  DATA_PTR(self.value()) = new T(args...);
31  }
32  };
33 
35  template<typename T, typename ...Arg_T>
36  class Constructor<T, Object, Arg_T...>
37  {
38  public:
39  static void construct(Object self, Arg_T... args)
40  {
41  DATA_PTR(self.value()) = new T(self, args...);
42  }
43  };
44 }
45 
46 #endif
47 
Define a Type's Constructor and it's arguments.
Definition: Constructor.hpp:26
The base class for all Objects.
Definition: Object_defn.hpp:25