Since highDimension
is a template argument, point
becomes a dependent type, so you need to write template
here:
p.template set<0>(0);
As to why you need template
there, read the answer here:
BTW, you don't need typename
in the arguments:
typedef typename std::conditional<highDimension,
bg::model::point<double, 6, bg::cs::cartesian>,
bg::model::point<double, 5, bg::cs::cartesian>>::type point;
You could also use using
:
using point = typename std::conditional<highDimension,
bg::model::point<double, 6, bg::cs::cartesian>,
bg::model::point<double, 5, bg::cs::cartesian>>::type;
This looks better from readability point of view (IMHO).
Or you could simply write this:
using point = bg::model::point<double, highDimension?6:5, bg::cs::cartesian>;
Looks even better.