## SpatialSortingTraits_2

### Definition

All 2D spatial sorting algorithms provided in Cgal are parameterized by a traits class Traits, which defines the primitives (objects and predicates) that the sorting algorithms use. SpatialSortingTraits_2 defines the complete set of primitives required in these functions and functors.

### Types

 SpatialSortingTraits_2::Point_2 The point type on which the sorting algorithms operate. SpatialSortingTraits_2::Compute_x_2 Functor object type returning the x coordinate of a Point_2. Must provide FT operator()(Point_2 p) where FT can be used as argument of CGAL::to_double. SpatialSortingTraits_2::Compute_y_2 Functor object type returning the y coordinate of a Point_2. Must provide FT operator()(Point_2 p) where FT can be used as argument of CGAL::to_double. SpatialSortingTraits_2::Less_x_2 Binary predicate object type comparing Point_2s along the x coordinate. Must provide bool operator()(Point_2 p, Point_2 q) where true is returned iff px < qx, where px and qx denote x coordinate of point p and q, respectively. SpatialSortingTraits_2::Less_y_2 Binary predicate object type comparing Point_2s along the y coordinate. Must provide bool operator()(Point_2 p, Point_2 q) where true is returned iff py < qy, where py and qy denote y coordinate of point p and q, respectively.

### Creation

Only a copy constructor is required.

 SpatialSortingTraits_2 traits ( t);

### Operations

The following member functions to create instances of the above predicate object types must exist.

 Compute_x_2 traits.compute_x_2_object () Compute_y_2 traits.compute_y_2_object () Less_x_2 traits.less_x_2_object () Less_y_2 traits.less_y_2_object ()