MPQC  2.3.1
Public Types | Public Member Functions | List of all members
sc::auto_vec< T > Class Template Reference

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

#include <autovec.h>

Public Types

typedef T element_type
 

Public Member Functions

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

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() [1/2]

template<class T>
sc::auto_vec< T >::auto_vec ( T *  d = 0)
throw (
)
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[...].

◆ auto_vec() [2/2]

template<class T>
sc::auto_vec< T >::auto_vec ( auto_vec< T > &  av)
throw (
)
inline

Create a auto_vec, transferring the storage from another.

◆ ~auto_vec()

template<class T>
sc::auto_vec< T >::~auto_vec ( )
throw (
)
inline

This will delete the vector.

Member Function Documentation

◆ get()

template<class T>
T* sc::auto_vec< T >::get ( ) const
throw (
)
inline

Returns the pointer.

◆ operator=()

template<class T>
auto_vec& sc::auto_vec< T >::operator= ( auto_vec< T > &  av)
throw (
)
inline

This member transfers the data from av to this.

◆ operator[]()

template<class T>
T& sc::auto_vec< T >::operator[] ( size_t  i)
throw (
)
inline

Returns the i'th element.

◆ release()

template<class T>
T* sc::auto_vec< T >::release ( )
throw (
)
inline

Release ownership.

◆ reset()

template<class T>
void sc::auto_vec< T >::reset ( T *  d = 0)
throw (
)
inline

Assign to a new value.

Referenced by sc::auto_vec< double >::operator=().


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

Generated at Fri Feb 16 2018 01:48:56 for MPQC 2.3.1 using the documentation package Doxygen 1.8.14.