|
Teuchos - Trilinos Tools Package Version of the Day
|
Partial specialization of ArrayView for const T. More...
#include <Teuchos_ArrayViewDecl.hpp>
Public Member Functions | |
| ArrayView< const T > | getConst () const |
| Return a const view of *this. | |
Views | |
| operator ArrayView< const T > () const | |
| Implicitly convert an ArrayView<T> to an ArrayView<const T>. | |
Assignment | |
| void | assign (const ArrayView< const T > &array) const |
| Copy the data from one array view object to this array view object. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| ArrayView< T > | arrayView (T *p, typename ArrayView< T >::size_type size) |
| Construct a const or non-const view to const or non-const data. | |
| ArrayView< T > | arrayViewFromVector (std::vector< T > &vec) |
| Construct a non-const view of an std::vector. | |
| ArrayView< const T > | arrayViewFromVector (const std::vector< T > &vec) |
| Construct a const view of an std::vector. | |
| std::vector< T > | createVector (const ArrayView< T > &av) |
| Get a new std::vector<T> object out of an ArrayView<T> object. | |
| std::vector< T > | createVector (const ArrayView< const T > &av) |
| Get a new std::vector<T> object out of an ArrayView<const T> object. | |
| bool | is_null (const ArrayView< T > &av) |
| Returns true if av.is_null()==true. | |
| bool | nonnull (const ArrayView< T > &av) |
| Returns true if av.get()!=NULL. | |
| std::ostream & | operator<< (std::ostream &out, const ArrayView< T > &av) |
| Output stream inserter. | |
| ArrayView< T2 > | av_const_cast (const ArrayView< T1 > &p1) |
| Const cast of underlying ArrayView type from const T* to T*. | |
| ArrayView< T2 > | av_reinterpret_cast (const ArrayView< T1 > &p1) |
| Reinterpret cast of underlying ArrayView type from T1* to T2*. | |
Partial specialization of ArrayView for const T.
The main documentation for ArrayView explains why this class needs a partial specialization for const types.
Definition at line 400 of file Teuchos_ArrayViewDecl.hpp.
| ArrayView< const T > Teuchos::ArrayView< const T >::getConst | ( | ) | const |
Return a const view of *this.
This object is already const (this is a specialization for const T), so this method is trivial; it just returns *this.
|
inline |
Implicitly convert an ArrayView<T> to an ArrayView<const T>.
Definition at line 262 of file Teuchos_ArrayView.hpp.
| void Teuchos::ArrayView< T >::assign | ( | const ArrayView< const T > & | array | ) | const |
Copy the data from one array view object to this array view object.
Preconditions:
Definition at line 286 of file Teuchos_ArrayView.hpp.
|
Construct a const or non-const view to const or non-const data.
|
Construct a non-const view of an std::vector.
|
Construct a const view of an std::vector.
|
Get a new std::vector<T> object out of an ArrayView<T> object.
Note that a copy of data is made!
|
Get a new std::vector<T> object out of an ArrayView<const T> object.
Note that a copy of data is made!
|
Returns true if av.is_null()==true.
|
Returns true if av.get()!=NULL.
|
Output stream inserter.
The implementation of this function just prints pointer addresses and therefore puts no restrictions on the data types involved.
|
Const cast of underlying ArrayView type from const T* to T*.
The function will compile only if (const_cast<T2*>(p1.get());) compiles.
|
Reinterpret cast of underlying ArrayView type from T1* to T2*.
The function will compile only if (reinterpret_cast<T2*>(p1.get());) compiles.
Warning! Do not use this function unless you absolutely know what you are doing. Doing a reinterpret cast is always a tricking thing and must only be done by developers who are 100% comfortable with what they are doing.