On 07.01.2014 09:30, Fabian Greif wrote:
Hello,
I have currently the following problem: I want to use the SmartPointer with an array type datatype e.g. char[13].
The following contructors are implemented:
1.) SmartPointer () default constructor with empty payload
2.) SmartPointer (uint8_t size) Allocates memory from the given size.
3.) template<typename T > SmartPointer (const T *data)
4.) SmartPointer (const SmartPointer &other)
The third variant is not useable with pointer type data, because the memory gets only calculated for the size of the pointer.
Are you sure about this? sizeof(char[13]) is 13 and different from sizeof(char*).
Oh sorry, my reinterpret_cast was one byte to short for my Datatype, which destroyed my code there. You are right the SmartPointer is also working for arrays. Best Regards, Thorsten
_______________________________________________ xpcc-dev mailing list xpcc-dev@lists.rwth-aachen.de http://mailman.rwth-aachen.de/mailman/listinfo/xpcc-dev