00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(INCLUDED_GENERIC_OBJECT_H)
00023 #define INCLUDED_GENERIC_OBJECT_H
00024
00029
00030 #include <new>
00031
00032 template<typename Type>
00033 inline void constructor(Type& object) {
00034 new(&object) Type();
00035 }
00036
00037 template<typename Type, typename T1>
00038 inline void constructor(Type& object, const T1& t1) {
00039 new(&object) Type(t1);
00040 }
00041
00042 template<typename Type, typename T1, typename T2>
00043 inline void constructor(Type& object, const T1& t1, const T2& t2) {
00044 new(&object) Type(t1, t2);
00045 }
00046
00047 template<typename Type, typename T1, typename T2, typename T3>
00048 inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3) {
00049 new(&object) Type(t1, t2, t3);
00050 }
00051
00052 template<typename Type, typename T1, typename T2, typename T3, typename T4>
00053 inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4) {
00054 new(&object) Type(t1, t2, t3, t4);
00055 }
00056
00057 template<typename Type, typename T1, typename T2, typename T3, typename T4, typename T5>
00058 inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {
00059 new(&object) Type(t1, t2, t3, t4, t5);
00060 }
00061
00062 template<typename Type, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
00063 inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) {
00064 new(&object) Type(t1, t2, t3, t4, t5, t6);
00065 }
00066
00067 template<typename Type, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
00068 inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) {
00069 new(&object) Type(t1, t2, t3, t4, t5, t6, t7);
00070 }
00071
00072 template<typename Type, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
00073 inline void constructor(Type& object, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) {
00074 new(&object) Type(t1, t2, t3, t4, t5, t6, t7, t8);
00075 }
00076
00077 template<typename Type>
00078 inline void destructor(Type& object) {
00079 object.~Type();
00080 }
00081
00082
00083
00084 #endif