On 16 April 2014 11:28, Georgios Samaras
The compiler is right, as in this context of template instantiation, M must denote a constant expression and M must not be evaluated at run-time.
The compiler is "always" right. How Boost.Geometry allows me to achieve my purpose (i.e. creating a M-dimension point)? I tried to work around it, but I failed and can not find any workable solutions in Google. Moreover, I didn't find anything about that in the docs.
First, you need to understand requirements on non-type template
parameters in C++
(dimension is an integer, not a type), that it must be a constant expression
known at compile-time, *not* run-time!
Second, look at docs for geometry model, namely point
http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/referen...
The example presents how to instantiate point template to generate
types for 2D and 3D points:
bg::model::point