47#ifndef _util_misc_autovec_h
48#define _util_misc_autovec_h
51#include <util/misc/exception.h>
62 typedef T element_type;
67 explicit auto_vec(T*d = 0) MPQC__NOEXCEPT: d_(d) {}
82 T*
get() const MPQC__NOEXCEPT {
return d_; }
88 const T &
operator[](
size_t i)
const MPQC__NOEXCEPT {
return d_[i]; }
98 void reset(T*d=0) MPQC__NOEXCEPT {
The auto_vec class functions much like auto_ptr, except it contains references to arrays.
Definition autovec.h:59
T * get() const MPQC__NOEXCEPT
Returns the pointer.
Definition autovec.h:82
T & operator[](size_t i) MPQC__NOEXCEPT
Returns the i'th element.
Definition autovec.h:85
auto_vec(T *d=0) MPQC__NOEXCEPT
Creates a new auto_vec for a vector, d, of type T.
Definition autovec.h:67
void reset(T *d=0) MPQC__NOEXCEPT
Assign to a new value.
Definition autovec.h:98
const T & operator[](size_t i) const MPQC__NOEXCEPT
Returns the i'th element.
Definition autovec.h:88
~auto_vec() MPQC__NOEXCEPT
This will delete the vector.
Definition autovec.h:73
auto_vec(auto_vec &av) MPQC__NOEXCEPT
Create a auto_vec, transferring the storage from another.
Definition autovec.h:70
auto_vec & operator=(auto_vec &av) MPQC__NOEXCEPT
This member transfers the data from av to this.
Definition autovec.h:76
T * release() MPQC__NOEXCEPT
Release ownership.
Definition autovec.h:91
Contains all MPQC code up to version 3.
Definition mpqcin.h:14