On 09/03/2016 at 15:38, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17
Platform: Mac OSX ;
Language(s) : C++ ;
---------
hi,
I'm not sure if we can call that a bug or if it's problem with my syntax.
i've defined a class using template with several typename. NewObj doesn't want those templates.
i've got the message "parse issue"
: Expected '>'
: Type name requires a specifier or qualifier
a very simplified class :
template <typename T, typename T2>
class myclass
{
public:
T toto;
T2 tata;
myclass();
~myclass();
};
template <typename T, typename T2> myclass<T, T2>::myclass() { }
template <typename T, typename T2> myclass<T, T2>::~myclass(){ }
//somewhere else
// got the error message
myclass<Int32, Vector>* titi = NewObj(myclass<Int32, Vector>);
the following code generate error :
: Too many arguments provided to function-like macro invocation
: Use of undeclared identifier 'SIZEOF'
Int theSize = SIZEOF(myclass<Int32, Vector>);
but the following compile with no errors (but i know it's not a clean solution) :
myclass<Int32, Vector>* toto = MAXON_SAFE_PLACEMENT_NEW(maxon::DefaultAllocator::Alloc((maxon::Int)sizeof(myclass<Int32, Vector>), C4D_MISC_ALLOC_LOCATION)) myclass<Int32, Vector>();
It does work if myclass only got one typename.
Thanks a lot.