Files
cgal/STL_Extension/doc_tex/STL_Extension_ref/array.tex
T
Sylvain Pion 53f5c9679b Add a using directive "using std::array" in namespace CGAL to import either:
- C++0x's std:array from <array>
- TR1's std::tr1::array from <tr1/array>
- boost::array from <boost/array.hpp>
Motivation : GCC's std::array is faster than boost::array.

Move CGALi:make_array to namespace CGAL.

Document CGAL::array.
2008-08-26 13:08:16 +00:00

52 lines
1.9 KiB
TeX

%% =============================================================================
%% The CGAL Reference Manual
%% Chapter: STL Extensions - The Reference Part
%% -----------------------------------------------------------------------------
%% author: Sylvain Pion
%% -----------------------------------------------------------------------------
%% $Id$
%% $URL$
%% =============================================================================
%% +=========================================================================+
\begin{ccRefClass}{array<T, int>}
\ccDefinition
An object of the class \ccClassTemplateName\ represents an array of elements
of type \ccc{T}, the number of which is specified by the second template argument.
There is actually no class in \cgal\ with this name, but a using declaration which
imports a class from another namespace. By order of priority: the one in namespace
\ccc{std} is used (provided by C++0x), if not found, then the one in namespace
\ccc{std::tr1} is used (provided by TR1), and finally, the fallback solution
is taken from Boost.
\ccInclude{CGAL/array.h}
%% +-----------------------------------+
\ccParameters
The parameter \ccStyle{T} is the value type. The second parameter is the
dimension of the array.
%% +-----------------------------------+
\ccHeading{Construction functions}
The array class does not provide a constructor which can be used to initialize
data members. \cgal\ therefore provides a \ccc{make_array} function for
this purpose, up to a certain number of arguments.
\def\ccTagRmEigenClassName{\ccFalse}
\ccFunction{template <class T> array<T, 1> make_array(const T& a);}
{returns an array of dimension 1 whose first element is \ccc{a}.}
\ccFunction{template <class T> array<T, 2> make_array(const T& a1, const T& a2);}
{returns an array of dimension 2 whose first element is \ccc{a1}
and second element is \ccc{a2}.}
\end{ccRefClass}
\ccParDims