Processing math: 100%
CGAL Version:
master
6.0.1
latest
5.6.2
5.5.5
5.4.5
5.3.2
5.2.4
5.1.5
5.0.4
4.14.3
4.13.2
4.12.2
4.11.3
4.10.2
4.9.1
4.8.2
4.7
4.6.3
4.5.2
4.4
4.3
4.5
Home
Getting Started
Package Overview
Acknowledging CGAL
CGAL 4.5 - STL Extensions for CGAL
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
CGAL 4.5 - STL Extensions for CGAL
User Manual
Reference Manual
Deprecated List
Is Model Relationships
Has Model Relationships
Type Requirements
Bibliographic References
Class and Concept List
Examples
STL_Extension/Default.cpp
STL_Extension/in_place_list_prog.cpp
STL_Extension/min_element_if_example.cpp
STL_Extension/min_max_element_example.cpp
STL_Extension/Default.cpp
#include <CGAL/Default.h>
#include <CGAL/use.h>
// A is a concrete type
struct
A {};
void
use_a(A) {}
// B is the template class which has 2 template parameters
// with default arguments : A and int.
template
<
typename
A1_ = A,
typename
A2 =
int
>
struct
B
{
B()
: a1()
{}
// Note that it is also possible to use CGAL::Default
// instead of A as the default argument for A1_ above.
// Extract the desired type for A1 :
typedef
typename
CGAL::Default::Get<A1_, A>::type
A1;
A1 a1;
};
int
main ()
{
B<CGAL::Default, double> b;
use_a(b.a1);
// It is really of type A.
}