Boost logo

Boost Users :

Subject: Re: [Boost-users] can not compile nearest neighbors in d dimensions
From: Mateusz Łoskot (mateusz_at_[hidden])
Date: 2014-04-15 19:14:12


On 16 April 2014 00:41, Georgios Samaras <georgesamarasdit_at_[hidden]> wrote:
> I can not create a point in d(in the code M is dimensions) dimensions.
> The error is this:
> error: the value of ‘M’ is not usable in a constant expression
> note: ‘int M’ is not const
> error: template argument 2 is invalid
>
> and the line is this:
> int M;
> ..
> typedef bg::model::point<float, M, bg::cs::cartesian> point;

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.

This error has nothing to do with a problem in Boost.Geometry,
but it indicates problem in your program, misuse of the class template(s).

Best regards,

-- 
Mateusz  Łoskot, http://mateusz.loskot.net

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