MPQC  3.0.0-alpha
sc::auto_vec< T > Class Template Reference

The auto_vec class functions much like auto_ptr, except it contains references to arrays. More...

#include <util/misc/autovec.h>

Public Types

typedef T element_type
 

Public Member Functions

 auto_vec (T *d=0) MPQC__NOEXCEPT
 Creates a new auto_vec for a vector, d, of type T. More...
 
 auto_vec (auto_vec &av) MPQC__NOEXCEPT
 Create a auto_vec, transferring the storage from another.
 
 ~auto_vec () MPQC__NOEXCEPT
 This will delete the vector.
 
auto_vecoperator= (auto_vec &av) MPQC__NOEXCEPT
 This member transfers the data from av to this.
 
T * get () const MPQC__NOEXCEPT
 Returns the pointer.
 
T & operator[] (size_t i) MPQC__NOEXCEPT
 Returns the i'th element.
 
const T & operator[] (size_t i) const MPQC__NOEXCEPT
 Returns the i'th element.
 
T * release () MPQC__NOEXCEPT
 Release ownership.
 
void reset (T *d=0) MPQC__NOEXCEPT
 Assign to a new value.
 

Detailed Description

template<class T>
class sc::auto_vec< T >

The auto_vec class functions much like auto_ptr, except it contains references to arrays.

The delete[] operator will be used to deallocate data.

Constructor & Destructor Documentation

◆ auto_vec()

template<class T>
sc::auto_vec< T >::auto_vec ( T *  d = 0)
inlineexplicit

Creates a new auto_vec for a vector, d, of type T.

The d argument must be created with the vector new operator: new T[...].


The documentation for this class was generated from the following file:

Generated at Sun Jan 26 2020 23:24:03 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.