Z3
Public Member Functions
array< T > Class Template Reference

Public Member Functions

 array (unsigned sz)
 
template<typename T2 >
 array (ast_vector_tpl< T2 > const &v)
 
 ~array ()
 
void resize (unsigned sz)
 
unsigned size () const
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
const T * ptr () const
 
T * ptr ()
 

Detailed Description

template<typename T>
class z3::array< T >

Definition at line 394 of file z3++.h.

Constructor & Destructor Documentation

◆ array() [1/2]

array ( unsigned  sz)
inline

Definition at line 400 of file z3++.h.

400 :m_size(sz) { m_array = new T[sz]; }

◆ array() [2/2]

array ( ast_vector_tpl< T2 > const &  v)

Definition at line 1989 of file z3++.h.

1989  {
1990  m_array = new T[v.size()];
1991  m_size = v.size();
1992  for (unsigned i = 0; i < m_size; i++) {
1993  m_array[i] = v[i];
1994  }
1995  }

◆ ~array()

~array ( )
inline

Definition at line 403 of file z3++.h.

403 { delete[] m_array; }

Member Function Documentation

◆ operator[]() [1/2]

T& operator[] ( int  i)
inline

Definition at line 406 of file z3++.h.

406 { assert(0 <= i); assert(static_cast<unsigned>(i) < m_size); return m_array[i]; }

◆ operator[]() [2/2]

const T& operator[] ( int  i) const
inline

Definition at line 407 of file z3++.h.

407 { assert(0 <= i); assert(static_cast<unsigned>(i) < m_size); return m_array[i]; }

◆ ptr() [1/2]

T* ptr ( )
inline

Definition at line 409 of file z3++.h.

409 { return m_array; }

◆ ptr() [2/2]

const T* ptr ( ) const
inline

◆ resize()

void resize ( unsigned  sz)
inline

Definition at line 404 of file z3++.h.

404 { delete[] m_array; m_size = sz; m_array = new T[sz]; }

Referenced by solver::trail().

◆ size()

unsigned size ( ) const
inline