Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_ArrayRCPDecl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_ARRAY_RCP_DECL_HPP
11 #define TEUCHOS_ARRAY_RCP_DECL_HPP
12 
13 
14 #include "Teuchos_RCP.hpp"
15 #include "Teuchos_Exceptions.hpp"
16 #include "Teuchos_ArrayViewDecl.hpp"
17 
18 
19 namespace Teuchos {
20 
93 template<class T>
94 class ArrayRCP {
95 public:
97 
98 
100  typedef Teuchos_Ordinal Ordinal;
101 
104 
107 
109  typedef std::random_access_iterator_tag iterator_category;
110 
112  typedef T* iterator_type;
113 
115  typedef T value_type;
116 
118  typedef T& reference;
119 
121  typedef const T& const_reference;
122 
124  typedef T* pointer;
125 
127  typedef T* const_pointer;
128 
130  typedef T element_type;
131 
132 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
133  typedef ArrayRCP<T> iterator;
137 #else
138  typedef T* iterator;
141  typedef const T* const_iterator;
142 #endif
143 
145 
147 
160  inline ArrayRCP( ENull null_arg = null );
161 
184  bool has_ownership, const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP );
185 
208  template<class Dealloc_T>
209  inline ArrayRCP( T* p, size_type lowerOffset, size_type size, Dealloc_T dealloc,
210  bool has_ownership );
211 
227  inline explicit ArrayRCP( size_type size, const T& val = T() );
228 
247  inline ArrayRCP(const ArrayRCP<T>& r_ptr);
248 
259  inline ~ArrayRCP();
260 
288  inline ArrayRCP<T>& operator=(const ArrayRCP<T>& r_ptr);
289 
291 
293 
295  inline bool is_null() const;
296 
304  inline T* operator->() const;
305 
313  inline T& operator*() const;
314 
320  inline T* get() const;
321 
327  inline T* getRawPtr() const;
328 
334  inline T& operator[](size_type offset) const;
335 
337 
339 
348  inline ArrayRCP<T>& operator++();
349 
358  inline ArrayRCP<T> operator++(int);
359 
368  inline ArrayRCP<T>& operator--();
369 
378  inline ArrayRCP<T> operator--(int);
379 
388  inline ArrayRCP<T>& operator+=(size_type offset);
389 
398  inline ArrayRCP<T>& operator-=(size_type offset);
399 
412  inline ArrayRCP<T> operator+(size_type offset) const;
413 
426  inline ArrayRCP<T> operator-(size_type offset) const;
427 
429 
431 
442  inline iterator begin() const;
443 
454  inline iterator end() const;
455 
457 
459 
465  inline ArrayRCP<const T> getConst() const;
466 
481 
483 
485 
487  inline size_type lowerOffset() const;
488 
490  inline size_type upperOffset() const;
491 
496  inline size_type size() const;
497 
499 
501 
515  inline ArrayView<T> view( size_type lowerOffset, size_type size ) const;
516 
521  inline ArrayView<T> operator()( size_type lowerOffset, size_type size ) const;
522 
527  inline ArrayView<T> operator()() const;
528 
530 
532 
539  inline operator ArrayRCP<const T>() const;
540 
542 
544 
549  inline void assign(size_type n, const T &val);
550 
558  template<class Iter>
559  inline void assign(Iter first, Iter last);
560 
566  inline void deepCopy(const ArrayView<const T>& av);
567 
569  inline void resize(const size_type n, const T &val = T());
570 
575  inline void clear();
576 
578 
580 
592  inline ERCPStrength strength() const;
593 
603  inline bool is_valid_ptr() const;
604 
610  inline int strong_count() const;
611 
617  inline int weak_count() const;
618 
620  inline int total_count() const;
621 
639  inline void set_has_ownership();
640 
652  inline bool has_ownership() const;
653 
674  inline T* release();
675 
690  inline ArrayRCP<T> create_weak() const;
691 
707  inline ArrayRCP<T> create_strong() const;
708 
715  template<class T2>
716  inline bool shares_resource(const ArrayRCP<T2>& r_ptr) const;
717 
719 
721 
725  inline const ArrayRCP<T>& assert_not_null() const;
726 
732  inline const ArrayRCP<T>& assert_in_range( size_type lowerOffset, size_type size ) const;
733 
743  inline const ArrayRCP<T>& assert_valid_ptr() const;
744 
746 
747 private:
749  T *ptr_;
751  RCPNodeHandle node_;
753  size_type lowerOffset_;
755  size_type upperOffset_;
756 
757  inline void debug_assert_not_null () const {
758 #ifdef TEUCHOS_REFCOUNTPTR_ASSERT_NONNULL
759  assert_not_null();
760 #endif
761  }
762 
763  inline void
764  debug_assert_in_range (size_type lowerOffset_in,
765  size_type size_in) const
766  {
767  (void) lowerOffset_in;
768  (void) size_in;
769 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
770  assert_in_range (lowerOffset_in, size_in);
771 #endif
772  }
773 
774  inline void debug_assert_valid_ptr() const {
775 #ifdef TEUCHOS_DEBUG
776  assert_valid_ptr ();
777 #endif
778  }
779 
780 public:
781 
782 #ifndef DOXYGEN_COMPILE
783  // These constructors should be private but I have not had good luck making
784  // this portable (i.e. using friendship etc.) in the past
785  // This is a very bad breach of encapsulation that is needed since MS VC++
786  // 5.0 will not allow me to declare template functions as friends.
788  const RCPNodeHandle& node );
789  T* access_private_ptr() const;
790  RCPNodeHandle& nonconst_access_private_node();
791  const RCPNodeHandle& access_private_node() const;
792 #endif
793 
794 };
795 
796 
804 template<class T>
805 class ArrayRCP<const T> {
806 public:
807  typedef Teuchos_Ordinal Ordinal;
808  typedef Ordinal size_type;
809  typedef Ordinal difference_type;
810  typedef std::random_access_iterator_tag iterator_category;
811  typedef const T* iterator_type;
812  typedef const T value_type;
813  typedef const T& reference;
814  typedef const T& const_reference;
815  typedef const T* pointer;
816  typedef const T* const_pointer;
817  typedef const T element_type;
818 
819 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
820  typedef ArrayRCP<const T> iterator;
822 #else
823  typedef const T* iterator;
824  typedef const T* const_iterator;
825 #endif
826 
827  inline ArrayRCP (ENull null_arg = null);
828  inline ArrayRCP (const T* p, size_type lowerOffset,
829  size_type size, bool has_ownership,
830  const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP);
831  template<class Dealloc_T>
832  inline ArrayRCP (const T* p, size_type lowerOffset, size_type size,
833  Dealloc_T dealloc, bool has_ownership);
834  inline explicit ArrayRCP (size_type size, const T& val = T ());
835  inline ArrayRCP (const ArrayRCP<const T>& r_ptr);
836  inline ~ArrayRCP();
837 
838  inline ArrayRCP<const T>& operator= (const ArrayRCP<const T>& r_ptr);
839  inline bool is_null() const;
840  inline const T* operator->() const;
841  inline const T& operator*() const;
842  inline const T* get() const;
843  inline const T* getRawPtr() const;
844  inline const T& operator[] (size_type offset) const;
845 
846  inline ArrayRCP<const T>& operator++ ();
847  inline ArrayRCP<const T> operator++ (int);
848  inline ArrayRCP<const T>& operator-- ();
849  inline ArrayRCP<const T> operator-- (int);
850  inline ArrayRCP<const T>& operator+= (size_type offset);
851  inline ArrayRCP<const T>& operator-= (size_type offset);
852  inline ArrayRCP<const T> operator+ (size_type offset) const;
853  inline ArrayRCP<const T> operator- (size_type offset) const;
854 
855  inline iterator begin() const;
856  inline iterator end() const;
857 
863  inline ArrayRCP<const T> getConst () const;
864  inline ArrayRCP<const T> persistingView (size_type lowerOffset, size_type size) const;
865 
866  inline size_type lowerOffset() const;
867  inline size_type upperOffset() const;
868  inline size_type size() const;
869 
870  inline ArrayView<const T> view (size_type lowerOffset, size_type size) const;
871  inline ArrayView<const T> operator() (size_type lowerOffset, size_type size) const;
872  inline ArrayView<const T> operator() () const;
873 
874  inline void resize (const size_type n, const T& val = T ());
875  inline void clear ();
876 
877  inline ERCPStrength strength() const;
878  inline bool is_valid_ptr() const;
879  inline int strong_count() const;
880  inline int weak_count() const;
881  inline int total_count() const;
882  inline void set_has_ownership();
883  inline bool has_ownership() const;
884  inline const T* release();
885  inline ArrayRCP<const T> create_weak() const;
886  inline ArrayRCP<const T> create_strong() const;
887 
888  template<class T2>
889  inline bool shares_resource (const ArrayRCP<T2>& r_ptr) const;
890 
891  inline const ArrayRCP<const T>& assert_not_null () const;
892  inline const ArrayRCP<const T>& assert_in_range (size_type lowerOffset, size_type size) const;
893  inline const ArrayRCP<const T>& assert_valid_ptr() const;
894 
895 private:
896  const T* ptr_; // NULL if this pointer is null
897  RCPNodeHandle node_; // NULL if this pointer is null
898  size_type lowerOffset_; // 0 if this pointer is null
899  size_type upperOffset_; // -1 if this pointer is null
900 
901  inline void debug_assert_not_null() const {
902 #ifdef TEUCHOS_REFCOUNTPTR_ASSERT_NONNULL
903  assert_not_null ();
904 #endif
905  }
906 
907  inline void
908  debug_assert_in_range (size_type lowerOffset_in,
909  size_type size_in) const
910  {
911  (void) lowerOffset_in; (void) size_in;
912 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
913  assert_in_range (lowerOffset_in, size_in);
914 #endif
915  }
916 
917  inline void debug_assert_valid_ptr() const {
918 #ifdef TEUCHOS_DEBUG
919  assert_valid_ptr ();
920 #endif
921  }
922 
923 public:
924 
925 #ifndef DOXYGEN_COMPILE
926  // These constructors should be private but I have not had good luck making
927  // this portable (i.e. using friendship etc.) in the past
928  // This is a very bad breach of encapsulation that is needed since MS VC++
929  // 5.0 will not allow me to declare template functions as friends.
930  ArrayRCP (const T* p, size_type lowerOffset,
931  size_type size, const RCPNodeHandle& node);
932  const T* access_private_ptr() const;
933  RCPNodeHandle& nonconst_access_private_node();
934  const RCPNodeHandle& access_private_node() const;
935 #endif
936 };
937 
938 
947 template<>
948 class ArrayRCP<void> {
949 public:
950  typedef Teuchos_Ordinal Ordinal;
951  typedef Ordinal size_type;
952  typedef Ordinal difference_type;
953  typedef std::random_access_iterator_tag iterator_category;
954  typedef void* iterator_type;
955  typedef void value_type;
957  // typedef T& reference; // these are not valid
959  // typedef const T& const_reference; // these are not valid
960  typedef void* pointer;
961  typedef void* const_pointer;
962  typedef void element_type;
963 
965  inline ArrayRCP ();
966 };
967 
972 template<>
973 class ArrayRCP<const void> {
974 public:
975  typedef Teuchos_Ordinal Ordinal;
976  typedef Ordinal size_type;
977  typedef Ordinal difference_type;
978  typedef std::random_access_iterator_tag iterator_category;
979  typedef const void* iterator_type;
980  typedef const void value_type;
982  // typedef T& reference; // these are not valid
984  // typedef const T& const_reference; // these are not valid
985  typedef const void* pointer;
986  typedef const void* const_pointer;
987  typedef const void element_type;
988 
990  inline ArrayRCP ();
991 };
992 
993 // 2008/09/22: rabartl: NOTE: I removed the TypeNameTraits<ArrayRCP<T> >
994 // specialization since I want to be able to print the type name of an
995 // ArrayRCP that does not have the type T fully defined!
996 
997 
1002 template<typename T>
1004 public:
1005  static ArrayRCP<T> getNull() { return null; }
1006 };
1007 
1008 
1014 template<class T>
1015 ArrayRCP<T> arcp(
1016  T* p,
1017  typename ArrayRCP<T>::size_type lowerOffset,
1018  typename ArrayRCP<T>::size_type size,
1019  bool owns_mem = true
1020  );
1021 
1022 
1028 template<class T, class Dealloc_T>
1029 ArrayRCP<T> arcp(
1030  T* p,
1031  typename ArrayRCP<T>::size_type lowerOffset,
1032  typename ArrayRCP<T>::size_type size,
1033  Dealloc_T dealloc, bool owns_mem
1034  );
1035 
1036 
1047 template<class T>
1048 ArrayRCP<T> arcp( typename ArrayRCP<T>::size_type size );
1049 
1050 
1064 template<class T>
1065 ArrayRCP<T> arcpCloneNode( const ArrayRCP<T> &a );
1066 
1067 
1072 template<class T>
1073 ArrayRCP<T> arcpClone( const ArrayView<const T> &v );
1074 
1075 
1086 template<class T, class Embedded>
1088 arcpWithEmbeddedObjPreDestroy(
1089  T* p,
1090  typename ArrayRCP<T>::size_type lowerOffset,
1091  typename ArrayRCP<T>::size_type size,
1092  const Embedded &embedded,
1093  bool owns_mem = true
1094  );
1095 
1096 
1107 template<class T, class Embedded>
1109 arcpWithEmbeddedObjPostDestroy(
1110  T* p,
1111  typename ArrayRCP<T>::size_type lowerOffset,
1112  typename ArrayRCP<T>::size_type size,
1113  const Embedded &embedded,
1114  bool owns_mem = true
1115  );
1116 
1117 
1129 template<class T, class Embedded>
1131 arcpWithEmbeddedObj(
1132  T* p,
1133  typename ArrayRCP<T>::size_type lowerOffset,
1134  typename ArrayRCP<T>::size_type size,
1135  const Embedded &embedded,
1136  bool owns_mem = true
1137  );
1138 
1139 
1145 template<class T>
1146 ArrayRCP<T> arcp( const RCP<std::vector<T> > &v );
1147 
1148 
1154 template<class T>
1155 ArrayRCP<const T> arcp( const RCP<const std::vector<T> > &v );
1156 
1157 
1166 template<class T>
1167 ArrayRCP<T> arcpFromArrayView(const ArrayView<T> &av);
1168 
1169 
1177 template<class T>
1178 RCP<std::vector<T> > get_std_vector( const ArrayRCP<T> &ptr );
1179 
1180 
1187 template<class T>
1188 RCP<const std::vector<T> > get_std_vector( const ArrayRCP<const T> &ptr );
1189 
1190 
1195 template<class T>
1196 bool is_null( const ArrayRCP<T> &p );
1197 
1198 
1203 template<class T>
1204 bool nonnull( const ArrayRCP<T> &p );
1205 
1206 
1211 template<class T>
1212 bool operator==( const ArrayRCP<T> &p, ENull );
1213 
1214 
1219 template<class T>
1220 bool operator!=( const ArrayRCP<T> &p, ENull );
1221 
1222 
1227 template<class T1, class T2>
1228 bool operator==( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1229 
1230 
1235 template<class T1, class T2>
1236 bool operator!=( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1237 
1238 
1243 template<class T1, class T2>
1244 bool operator<( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1245 
1246 
1251 template<class T1, class T2>
1252 bool operator<=( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1253 
1254 
1259 template<class T1, class T2>
1260 bool operator>( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1261 
1262 
1267 template<class T1, class T2>
1268 bool operator>=( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1269 
1270 
1278 template<class T>
1280 operator-( const ArrayRCP<T> &p1, const ArrayRCP<T> &p2 );
1281 
1282 
1293 template<class T2, class T1>
1294 inline
1295 ArrayRCP<T2> arcp_const_cast(const ArrayRCP<T1>& p1);
1296 
1297 
1309 template<class T2, class T1>
1310 ArrayRCP<T2> arcp_reinterpret_cast(const ArrayRCP<T1>& p1);
1311 
1312 
1329 template<class T2, class T1>
1330 ArrayRCP<T2> arcp_reinterpret_cast_nonpod(const ArrayRCP<T1>& p1, const T2& val=T2());
1331 
1332 
1358 template<class T2, class T1>
1359 inline
1360 ArrayRCP<T2> arcp_implicit_cast(const ArrayRCP<T1>& p1);
1361 
1362 
1421 template<class T1, class T2>
1422 void set_extra_data(
1423  const T1 &extra_data, const std::string& name,
1424  const Ptr<ArrayRCP<T2> > &p, EPrePostDestruction destroy_when = POST_DESTROY,
1425  bool force_unique = true );
1426 
1427 
1447 template<class T1, class T2>
1448 T1& get_extra_data( ArrayRCP<T2>& p, const std::string& name );
1449 
1450 
1476 template<class T1, class T2>
1477 const T1& get_extra_data( const ArrayRCP<T2>& p, const std::string& name );
1478 
1479 
1504 template<class T1, class T2>
1505 T1* get_optional_extra_data( ArrayRCP<T2>& p, const std::string& name );
1506 
1507 
1537 template<class T1, class T2>
1538 const T1* get_optional_extra_data( const ArrayRCP<T2>& p, const std::string& name );
1539 
1540 
1551 template<class Dealloc_T, class T>
1552 Dealloc_T& get_nonconst_dealloc( const ArrayRCP<T>& p );
1553 
1554 
1572 template<class Dealloc_T, class T>
1573 const Dealloc_T& get_dealloc( const ArrayRCP<T>& p );
1574 
1575 
1590 template<class Dealloc_T, class T>
1591 const Dealloc_T* get_optional_dealloc( const ArrayRCP<T>& p );
1592 
1593 
1615 template<class Dealloc_T, class T>
1616 Dealloc_T* get_optional_nonconst_dealloc( const ArrayRCP<T>& p );
1617 
1618 
1625 template<class TOrig, class Embedded, class T>
1626 const Embedded& getEmbeddedObj( const ArrayRCP<T>& p );
1627 
1628 
1635 template<class TOrig, class Embedded, class T>
1636 Embedded& getNonconstEmbeddedObj( const ArrayRCP<T>& p );
1637 
1638 
1646 template<class T>
1647 std::ostream& operator<<( std::ostream& out, const ArrayRCP<T>& p );
1648 
1649 
1650 } // end namespace Teuchos
1651 
1652 
1653 #endif // TEUCHOS_ARRAY_RCP_DECL_HPP
const T * const_iterator
Constant iterator type used if bounds checking is disabled.
std::random_access_iterator_tag iterator_category
Category of ArrayRCP&#39;s iterator type.
ArrayRCP< T > create_weak() const
Create a new weak reference from another (strong) reference.
const ArrayRCP< T > & assert_in_range(size_type lowerOffset, size_type size) const
Throws NullReferenceError if this-&gt;get()==NULL orthis-&gt;get()!=NULL, throws RangeError if (lowerOffset...
ArrayRCP(ENull null_arg=null)
Default constructor; initialize to an empty array.
ArrayRCP< T > persistingView(size_type lowerOffset, size_type size) const
Return a persisting view of a contiguous range of elements.
Partial specialization of ArrayRCP for const T.
Ordinal difference_type
Type representing the difference between two size_type values.
ArrayRCP< T > & operator++()
Prefix increment of pointer (i.e. ++ptr).
ArrayRCP< T > & operator+=(size_type offset)
Pointer integer increment (i.e. ptr+=offset).
int weak_count() const
Return the number of active RCP&lt;&gt; objects that have a &quot;weak&quot; reference to the underlying reference-co...
bool nonnull(const std::shared_ptr< T > &p)
Returns true if p.get()!=NULL.
bool is_null(const std::shared_ptr< T > &p)
Returns true if p.get()==NULL.
ArrayRCP< T > & operator-=(size_type offset)
Pointer integer increment (i.e. ptr-=offset).
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
size_type upperOffset() const
Return the upper offset to valid data.
ArrayRCP< T > & operator--()
Prefix decrement of pointer (i.e. –ptr).
T * release()
Release the ownership of the underlying array.
ArrayRCP< const T > getConst() const
Return object for only const access to data.
ENull
Used to initialize a RCP object to NULL using an implicit conversion!
void clear()
Resize to zero.
size_type size() const
The total number of entries in the array.
Ordinal size_type
Type representing the number of elements in an ArrayRCP or view thereof.
~ArrayRCP()
Destructor, that decrements the reference count.
ERCPStrength strength() const
Strength of the pointer.
bool shares_resource(const ArrayRCP< T2 > &r_ptr) const
Returns true if the smart pointers share the same underlying reference-counted object.
bool is_valid_ptr() const
Return whether the underlying object pointer is still valid.
const ArrayRCP< T > & assert_not_null() const
Throws NullReferenceError if this-&gt;get()==NULL, otherwise returns reference to *this.
T element_type
Type of each array element.
T * operator->() const
Pointer (-&gt;) access to members of underlying object for current position.
void resize(const size_type n, const T &val=T())
Resize and append new elements if necessary.
T * const_pointer
Type of a (raw) (constant) pointer to an array element.
Teuchos_Ordinal Ordinal
Integer index type used throughout ArrayRCP.
ArrayRCP< T > create_strong() const
Create a new strong RCP object from another (weak) RCP object.
T value_type
Type of each array element.
ArrayRCP< T > operator+(size_type offset) const
Pointer integer increment (i.e. ptr+offset).
void deepCopy(const ArrayView< const T > &av)
Deep copy the elements from one ArrayView object into this object.
size_type lowerOffset() const
Return the lower offset to valid data.
int total_count() const
Total count (strong_count() + weak_count()).
ERCPStrength
Used to specify if the pointer is weak or strong.
T & operator*() const
Dereference the underlying object for the current pointer position.
Base traits class for getting a properly initialized null pointer.
T * iterator_type
Type of an ArrayRCP&#39;s iterator.
const T & const_reference
Type of a (constant) reference to an array element.
T * pointer
Type of a (raw) (nonconstant) pointer to an array element.
Nonowning array view.
void set_has_ownership()
Give this and other ArrayRCP&lt;&gt; objects ownership of the underlying referenced array to delete it...
Handle class that manages the RCPNode&#39;s reference counting.
ArrayView< T > operator()() const
Return a nonpersisting view of *this.
ERCPNodeLookup
Used to determine if RCPNode lookup is performed or not.
EPrePostDestruction
Used to specify a pre or post destruction of extra data.
int strong_count() const
Return the number of active RCP&lt;&gt; objects that have a &quot;strong&quot; reference to the underlying reference-...
ArrayRCP< T > & operator=(const ArrayRCP< T > &r_ptr)
Assignment operator: Makes *this reference the input array.
ArrayRCP< T > operator-(size_type offset) const
Pointer integer decrement (i.e. ptr-offset).
Smart reference counting pointer class for automatic garbage collection.
T & operator[](size_type offset) const
Random object access.
T * iterator
Nonconstant iterator type used if bounds checking is disabled.
iterator end() const
Return an iterator to past the end of the array of data.
Partial specialization of ArrayView for const T.
T & reference
Type of a (nonconstant) reference to an array element.
bool is_null() const
True if the underlying pointer is null, else false.
Reference-counted pointer class and non-member templated function implementations.
const ArrayRCP< T > & assert_valid_ptr() const
If the object pointer is non-null, assert that it is still valid.
iterator begin() const
Return an iterator to beginning of the array of data.
bool has_ownership() const
Returns true if this has ownership of object pointed to by this-&gt;get() in order to deallocate it...
Simple wrapper class for raw pointers to single objects where no persisting relationship exists...
void assign(size_type n, const T &val)
Resize and assign n elements of val.
Reference-counted smart pointer for managing arrays.
ArrayView< T > view(size_type lowerOffset, size_type size) const
Return a nonpersisting view of a contiguous range of elements.