#include "cln/object.h"
#include "cln/V.h"
-#include "cln/abort.h"
+#include "cln/exception.h"
#include <cstdlib>
namespace cln {
template <class T>
class cl_SV_inner {
protected:
- uintL len; // number of elements
+ uintC len; // number of elements
private:
// T data[]; // the elements
T * data() { return (T *) (this+1); }
const T * data() const { return (const T *) (this+1); }
public:
- uintL length () const { return len; } // number of elements
+ uintC length () const { return len; } // number of elements
const T & operator[] (unsigned long index) const
{
#ifndef CL_SV_NO_RANGECHECKS
- if (!(index < length())) cl_abort();
+ if (!(index < length())) throw runtime_exception();
#endif
return data()[index];
}
T & operator[] (unsigned long index)
{
#ifndef CL_SV_NO_RANGECHECKS
- if (!(index < length())) cl_abort();
+ if (!(index < length())) throw runtime_exception();
#endif
return data()[index];
}
{ return operator[]((unsigned long)index); }
public: /* ugh */
// Constructor.
- cl_SV_inner (uintL l) : len (l) {}
+ cl_SV_inner (uintC l) : len (l) {}
public:
// Destructor.
~cl_SV_inner ();
template <class T>
inline cl_SV_inner<T>::~cl_SV_inner ()
{
- uintL i = len;
+ uintC i = len;
while (i > 0) {
i--;
data()[i].~T();
struct cl_SV : public BASE {
public:
// Length.
- uintL length () const
+ uintC length () const
{
return ((const cl_heap_SV<T> *) this->pointer)->v.length();
}