\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.12.2 - 2D and 3D Linear Geometry Kernel
CGAL::Dynamic_dimension_tag Struct Reference

#include <CGAL/Dimension.h>

Definition

An object of the class Dynamic_dimension_tag is an empty object which can be used for dispatching functions based on the dimension of an object.

Dynamic_dimension_tag indicates that the dimension is not known at compile-time. Dimension_tag is the tag class dealing with compile-time dimensions.

Example

The following code declares two functions constructing two points at the origin, either in 2D or in 3D.

Point_2<K> get_origin(Dimension_tag<2>) { return Point_2<K>(ORIGIN); }
Point_3<K> get_origin(Dimension_tag<3>) { return Point_3<K>(ORIGIN); }
Point_d<K> get_origin(Dynamic_dimension_tag) { return Point_d<K>(ORIGIN); }
std::cout << get_origin(Dynamic_dimension_tag())) << std::endl;
See also
CGAL::Dimension_tag<int dim>
CGAL::Ambient_dimension<T, K>
CGAL::Feature_dimension<T, K>