I increased and it compile. However, I am -again- not able to continue, because now it says point not declared..

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>

namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;

template <int CompileTimeDimension>
void do_something()
{
    typedef bg::model::point<float, CompileTimeDimension, bg::cs::cartesian> point;
    bgi::rtree<point, bgi::linear<8> > rt;
}

template <std::size_t D, std::size_t N>
struct fill
{
    template <typename Point>
    static void apply(Point& p, typename bg::coordinate_type<Point>::type const& v)
    {
        bg::set<D>(p, v);
        fill<D + 1, N>::apply(p, v);
    }
};
template <std::size_t N>
struct fill<N, N>
{
    template <typename Point>
    static void apply(Point&, typename bg::coordinate_type<Point>::type const&) {}
};


int main()
{
    int M;
    M = 100;
    if ( M == 100 )
        do_something<100>();
        else if ( M == 10000 )
        do_something<10000>();
        else
        std::cerr << "invalid dimension!";
    point p;    
    if ( M == 100 )
        fill<0, 100>::apply(p, 5);
        else if ( M == 10000 )
        fill<0, 10000>::apply(p, 5);
        else
        std::cerr << "invalid dimension!";   
    return 0;
}