[Insight-users] embarassingly basic question
Rupert Brooks
rupert.brooks at gmail.com
Thu Apr 26 14:16:17 EDT 2012
Thanks to all
Bill, your solution does work. We will probably end up creating
helper functions like Vladimir suggested. Until C++ 11 arrives :-)
Best,
Rupert
--------------------------------------------------------------
Rupert Brooks
rupert.brooks at gmail.com
On Wed, Apr 25, 2012 at 15:44, Rupert Brooks <rupert.brooks at gmail.com> wrote:
> Hi,
>
> Its when I show ITK to other people that I end up with embarassingly
> simple questions that I ought to know the answer to.
>
> When declaring an itk::Point (or vector, etc, anything based on
> FixedArray) there is no constructor that assigns values that i know
> of. So one always ends up doing something like
> itk::Point<double, 3> p;
> p[0]=1.1;
> p[1]=2.2;
> p[2]=3.3;
>
> or
>
> const double[3] dummy={1.1,2.2,3.3};
> const itk::Point<double, 3>=dummy; // at least this way we can get a
> const itk::Point
>
> It was pointed out to me that this is quite verbose. A certain ideal
> would be, eg
>
> const itk::Point<double,3> p(1.1,2.2,3.3);
>
> Is there a better way? Was this a design choice, or an inevitable
> consequence of variadic constructors not being possible in C++?
>
> Thanks,
> Rupert
>
> --------------------------------------------------------------
> Rupert Brooks
> rupert.brooks at gmail.com
More information about the Insight-users
mailing list