
Hi Alle,
2010/11/9 Alle Meije Wink
Dear Kris, thanks for your reply.
You are welcome.
template<typename T> class bisArray: public bisObject { typedef boost::variant < boost::multi_array_ref
, boost::multi_array_ref , boost::multi_array_ref , boost::multi_array_ref , boost::multi_array_ref , boost::multi_array_ref , boost::multi_array_ref , boost::multi_array_ref , boost::multi_array_ref bisArray_t; bisArray_t _bisArray;
However what I am stuck with seems to be, in essence, still the same thing:
/home/amwink/programs/cpp/bis/src/bisniftiimage.cpp||In function ‘void bis::bisReadNifti(std::string)’:| /home/amwink/programs/cpp/bis/src/bisniftiimage.cpp|102|warning: unused variable ‘testimage’| /usr/include/boost/variant/variant.hpp||In constructor ‘boost::variant
::variant() [with T0_ = boost::multi_array_ref , T1 = boost::multi_array_ref , T2 = boost::multi_array_ref , T3 = boost::multi_array_ref , T4 = boost::multi_array_ref , T5 = boost::multi_array_ref , T6 = boost::multi_array_ref , T7 = boost::multi_array_ref , T8 = boost::multi_array_ref , T9 = boost::detail::variant::void_, T10 = boost::detail::variant::void_, T11 = boost::detail::variant::void_, T12 = boost::detail::variant::void_, T13 = boost::detail::variant::void_, T14 = boost::detail::variant::void_, T15 = boost::detail::variant::void_, T16 = boost::detail::variant::void_, T17 = boost::detail::variant::void_, T18 = boost::detail::variant::void_, T19 = boost::detail::variant::void_]’:| /home/amwink/programs/cpp/bis/src/bisarray.hpp|52|instantiated from ‘bis::bisArray<T>::bisArray(T*, size_t, std::vector ) [with T = unsigned char]’| /home/amwink/programs/cpp/bis/src/bisimage.hpp|33|instantiated from ‘bis::bisImage<T>::bisImage(T*, size_t, std::vector ) [with T = unsigned char]’| /home/amwink/programs/cpp/bis/src/bisniftiimage.cpp|126|instantiated from here| /usr/include/boost/variant/variant.hpp|1198|error: no matching function for call to ‘boost::multi_array_ref ::multi_array_ref()’| /usr/include/boost/multi_array/multi_array_ref.hpp|623|note: candidates are: boost::multi_array_ref ::multi_array_ref(T*, const typename boost::const_multi_array_ref ::storage_order_type&, const typename boost::const_multi_array_ref ::index*, const typename boost::const_multi_array_ref ::size_type*) [with T = unsigned char, long unsigned int NumDims = 1ul]| /usr/include/boost/multi_array/multi_array_ref.hpp|469|note: boost::multi_array_ref ::multi_array_ref(T*, const boost::detail::multi_array::extent_gen<NumDims>&, const boost::general_storage_order<NumDims>&) [with T = unsigned char, long unsigned int NumDims = 1ul]| /usr/include/boost/multi_array/multi_array_ref.hpp|463|note: boost::multi_array_ref ::multi_array_ref(T*, const boost::detail::multi_array::extent_gen<NumDims>&) [with T = unsigned char, long unsigned int NumDims = 1ul]| /usr/include/boost/multi_array/multi_array_ref.hpp|417|note: boost::multi_array_ref ::multi_array_ref(const boost::multi_array_ref &)| ||=== Build finished: 1 errors, 1 warnings ===| So boost.variant now sugegsts that multi_array_ref() is called, a constructor with no arguments! I don't use that, and I don't even think it exists (because it produces a multi_array view of an *existing* C-style array!
The error sais, that the default constructor of multi_array_ref
The default ctor of each member is called if You don't specify another means of initialization in the constructor. Regards, Kris