|
Boost Users : |
From: Seweryn Habdank-Wojewódzki (habdank_at_[hidden])
Date: 2006-04-25 06:39:01
Hi!
I would like to know if in multi_array there is a possibility to initialize
multi_array using non-default constructor?
When I am using std::vector there is a possibility to do it like that:
std::vector<MyObject> my_object_vec ( 2, MyObject( parameters ) );
This vector constructor uses non-default constructor of MyObject. In C++ arrays
constructon like that should be done in two steps first is to initialize array
(uses default constructor) and then we could assign values to the array using
copy constructor, but this is not nice, and in my cases not good solution.
Important is that in MyObject class there shouldn't be default constructor, and
better not to use copy constructor. Of course there exists non-default
constructor like MyObject ( const Parameters & parameters ).
Regards.
-- |\/\/| Seweryn Habdank-Wojewódzki `\/\/
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net