Status: Accepted
Owner:
eugen.win...@gmail.com
CC:
stephane...@synchrotron-soleil.fr
Labels: Type-Defect Priority-Critical
New issue 4 by
eugen.win...@gmail.com: problems with = and copy
constructor for std::shared_ptr
http://code.google.com/p/cdma/issues/detail?id=4
Hi folks
This is a critical issue when using standard C++ smart pointers. It is easy
to fix so I could do this. However, I do not want to interfere with the
existing yat smart pointers.
The problem concerns conversions from raw pointers to smart pointers. This
is not supported in C++11. As an example see line 110 of Array.cpp:
m_data_impl = new DefaultArrayStorage<short>((short*) pData, shape);
This may works for yat shared pointers but not for C++11 shared pointers.
The solution is
m_data_impl = IArrayStoragePtr(new DefaultArrayStorage<short>((short*)
pData, shape));
Would the last line also work with yat smart pointers? If not one has to
handle this situation using #ifdef CDMA_STD_SMART_PTR throughout the entire
code.