CXXR (C++ R)
|
Information about the data payload. More...
#include <ElementTraits.hpp>
Public Types | |
typedef T | type |
Type of the data payload held in this element type. |
Static Public Member Functions | |
static const type & | get (const T &t) |
Access the data payload. |
Information about the data payload.
In some element types, including all the standard R atomic data types, the 'value' of a vector element is held directly in a data item of the element type T , and in that case a special value within the range of type T may be used to signify that an item of data is 'not available'.
However, CXXR also allows the possibility that a vector element type T can be a class type whose objects contain a value of some underlying type, representing the data 'payload', along with a separate flag (typically a bool) indicating whether or not the data is 'not available'.
This class provides facilities to allow generic programs to handle both these cases straightforwardly. As defined here, the class deals with the first case described above; specializations of the Data template can be used to address the second case.
T | A type capable of being used as the element type of an R data vector. |
|
inlinestatic |
Access the data payload.
t | Reference to an object of the element type. |