CGAL::Feature_dimension<T, K>

Definition

The class Feature_dimension<T, K> allows to retrieve the geometric dimension of a type T in a kernel K.

Parameters

The parameter K has the default value Kernel_traits<T>::Kernel.

#include <CGAL/Dimension.h>

Constants

static const int value; The dimension value as a compile-time integral constant. It is implemented as K::Feature_dimension<T>::type::value. It exists only when the dimension is a compile-time constant.

Types

Feature_dimension<T, K>::type
Either Dimension_tag<dim> if the dimension is a compile-time constant of value dim, or Dynamic_dimension_tag otherwise. It is implemented as K::Feature_dimension<T>::type.

Example

The following retrieves the dimension of a point type.

  typedef K::Point_2 Point;
  int dimension = Feature_dimension<Point, K>::value;
  assert(dimension == 0);

See Also

CGAL::Dimension_tag<int dim>
CGAL::Dynamic_dimension_tag
CGAL::Ambient_dimension<T, K>