|
Boost Users : |
From: Ronald Garcia (garcia_at_[hidden])
Date: 2006-04-26 10:50:24
Hi Seweryn,
At this time, there is no means to initialize a multi_array using a
non-default constructor in the way that you describe below.
Cheers,
ron
On Apr 25, 2006, at 6:39 AM, Seweryn Habdank-Wojewódzki wrote:
> 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 mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
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