FixedArray< 1, T > Class Template Reference

Partial template specialization for N = 1. More...

#include <FixedArray1.h>

List of all members.

Public Types

STL container requirements.

typedef Types::value_type value_type
 The element type of the array.
typedef Types::parameter_type parameter_type
 The parameter type for the value type.
typedef Types::pointer pointer
 A pointer to an array element.
typedef Types::const_pointer const_pointer
 A const pointer to an array element.
typedef Types::iterator iterator
 An iterator in the array.
typedef Types::const_iterator const_iterator
 A const iterator in the array.
typedef Types::reference reference
 A reference to an array element.
typedef Types::const_reference const_reference
 A const reference to an array element.
typedef Types::size_type size_type
 The size type is a signed integer.
typedef Types::difference_type difference_type
 Pointer difference type.

Public Member Functions

Constructors etc.

 FixedArray ()
 Default constructor. Leave the data uninitialized.
 ~FixedArray ()
 Trivial destructor.
 FixedArray (const FixedArray &other)
 Copy constructor.
template<typename T2 >
 FixedArray (const FixedArray< 1, T2 > &x)
 Copy constructor for a FixedArray of different type.
 FixedArray (parameter_type x)
 Constructor. Specify the component.
 FixedArray (const void *vp)
 Constructor. Initialize from a C array.
Assignment operators.

FixedArrayoperator= (const FixedArray &x)
 Assignment operator.
FixedArrayoperator= (parameter_type x)
 Assignment operator. Assign from a value.
template<typename T2 >
FixedArrayoperator= (const FixedArray< 1, T2 > &x)
 Assignment operator for a FixedArray of different type.
template<typename T2 , bool A>
FixedArrayoperator= (const Array< 1, T2, A > &x)
 Assignment operator for an Array.
Accessors.

const_iterator begin () const
 Return a const_iterator to the beginning of the data.
const_iterator end () const
 Return a const_iterator to the end of the data.
const_pointer data () const
 Return a const_pointer to the data.
parameter_type operator() (const int) const
 Subscripting. Return the i_th component.
parameter_type operator[] (const int) const
 Subscripting. Return the i_th component.
template<typename EqualityComparable >
const_iterator find (const EqualityComparable &x) const
 Linear search for x.
template<typename EqualityComparable >
int find_index (const EqualityComparable &x) const
 Linear search for x. Return the index of the matching element.
template<typename EqualityComparable >
bool has (const EqualityComparable &x) const
 Return true if this array has the element x.
bool is_sorted () const
 Return true.
template<class StrictWeakOrdering >
bool is_sorted (StrictWeakOrdering comp) const
 Return true.
int min_index () const
 Return 0.
template<class StrictWeakOrdering >
int min_index (StrictWeakOrdering comp) const
 Return 0.
int max_index () const
 Return 0.
template<class StrictWeakOrdering >
int max_index (StrictWeakOrdering comp) const
 Return 0.
Manipulators.

iterator begin ()
 Return an iterator to the beginning of the data.
iterator end ()
 Return an iterator to the end of the data.
pointer data ()
 Return a pointer to the data.
reference operator() (const int i)
 Subscripting. Return a reference to the i_th component.
reference operator[] (const int)
 Subscripting. Return a reference to the i_th component.
void swap (FixedArray &x)
 Swaps data with another FixedArray of the same size and type.
template<typename EqualityComparable >
iterator find (const EqualityComparable &x)
 Linear search for x.
void negate ()
 Negate each component.
void fill (parameter_type value)
 Fill the array with the given value.
template<typename InputIterator >
void copy (InputIterator start, InputIterator finish)
 Copy the specified range into the array.
void sort ()
 Sort the elements of the array.
template<class StrictWeakOrdering >
void sort (StrictWeakOrdering comp)
 Sort the elements of the array.
Assignment operators with scalar operand.

FixedArrayoperator+= (parameter_type x)
 Add x to each component.
FixedArrayoperator-= (parameter_type x)
 Subtract x from each component.
FixedArrayoperator*= (parameter_type x)
 Multiply each component by x.
FixedArrayoperator/= (parameter_type x)
 Divide each component by x.
FixedArrayoperator%= (parameter_type x)
 Mod each component by x.
FixedArrayoperator<<= (const int offset)
 Left-shift each component by the offset.
FixedArrayoperator>>= (const int offset)
 Right-shift each component by the offset.
Assignment operators with FixedArray operand.

template<typename T2 >
FixedArrayoperator+= (const FixedArray< 1, T2 > &x)
 Add x to this.
template<typename T2 >
FixedArrayoperator-= (const FixedArray< 1, T2 > &x)
 Subtract x from this.
template<typename T2 >
FixedArrayoperator*= (const FixedArray< 1, T2 > &x)
 Multiply this by x.
template<typename T2 >
FixedArrayoperator/= (const FixedArray< 1, T2 > &x)
 Divide this by x.
template<typename T2 >
FixedArrayoperator%= (const FixedArray< 1, T2 > &x)
 Mod this by x.

Static Public Member Functions

Static members.

static size_type size ()
 Return the size of the array.
static bool empty ()
 Return true if the array has zero size.
static size_type max_size ()
 Return the size of the largest possible FixedArray.

Detailed Description

template<typename T>
class FixedArray< 1, T >

Partial template specialization for N = 1.


Member Typedef Documentation

template<typename T >
typedef Types::size_type FixedArray< 1, T >::size_type

The size type is a signed integer.

Having std::size_t (which is an unsigned integer) as the size type causes minor problems. Consult "Large Scale C++ Software Design" by John Lakos for a discussion of using unsigned integers in a class interface.


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:51 2016 for Algorithms and Data Structures Package by  doxygen 1.6.3