52 template <
typename T, std::
size_t N>
74 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) 77 #elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310) 114 static bool empty() {
return false; }
119 inline void resize(
const size_t nElements) {
121 throw std::logic_error(
format(
"Try to change the size of a %u-CArray to %u.",static_cast<unsigned>(N),static_cast<unsigned>(nElements)));
126 std::swap_ranges(
begin(),
end(),
y.begin());
136 template <
typename T2>
151 if (N!=
n)
throw std::out_of_range(
"CArray<>: assign() of incorrect length");
157 template<
typename I>
void assign(I
b,
const I &e) {
159 if (
std::distance(
b,e)!=N)
throw std::out_of_range(
"CArray<>: assign() of incorrect length");
168 throw std::out_of_range(
"CArray<>: index out of range");
175 template <
typename T>
197 #if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) 200 #elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310) 224 throw std::out_of_range(
"CArray<0>: index out of range");
228 throw std::out_of_range(
"<0>: index out of range");
233 static bool empty() {
return true; }
244 const T*
data()
const {
return NULL; }
248 template <
typename T2 >
271 throw std::out_of_range(
"CArray<0>: index out of range");
276 template<
class T, std::
size_t N>
278 return std::equal(
x.begin(),
x.end(),
y.begin());
280 template<
class T, std::
size_t N>
282 return std::lexicographical_compare(
x.begin(),
x.end(),
y.begin(),
y.end());
284 template<
class T, std::
size_t N>
288 template<
class T, std::
size_t N>
292 template<
class T, std::
size_t N>
296 template<
class T, std::
size_t N>
const_reference back() const
bool operator!=(const CArray< T, N > &x, const CArray< T, N > &y)
std::ptrdiff_t difference_type
const_reference at(size_type i) const
reverse_iterator rbegin()
const_reverse_iterator rend() const
std::reverse_iterator< iterator > reverse_iterator
const_iterator begin() const
std::reverse_iterator< const_iterator > const_reverse_iterator
reference at(size_type i)
const T & const_reference
void assign(I b, const I &e)
void assign(const T &value)
void assign(const size_t n, const T &value)
void resize(const size_t nElements)
This method has no effects in this class, but raises an exception if the expected size does not match...
static size_type max_size()
const_iterator begin() const
reference operator[](size_type i)
void swap(CArray< T, N > &y)
CArray< T, N > & operator=(const CArray< T2, N > &rhs)
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
const_reference back() const
reference at(size_type i)
A STL container (as wrapper) for arrays of constant size defined at compile time. ...
const_iterator end() const
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
std::reverse_iterator< iterator > reverse_iterator
reverse_iterator rbegin()
const_reference front() const
bool operator>(const CArray< T, N > &x, const CArray< T, N > &y)
const_reverse_iterator rend() const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
const_reverse_iterator rbegin() const
std::reverse_iterator< const_iterator > const_reverse_iterator
const_reference operator[](size_type i) const
const_reverse_iterator rbegin() const
const_reference at(size_type i) const
static void makes_no_sense()
const_reference front() const
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
static void rangecheck(size_type i)
void swap(CArray< T, 0 > &y)
std::ptrdiff_t difference_type
GLsizei const GLfloat * value
static size_type max_size()
double BASE_IMPEXP distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
const_iterator end() const
reference operator[](size_type)
const_reference operator[](size_type) const
bool operator>=(const CArray< T, N > &x, const CArray< T, N > &y)
const T & const_reference