URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do assemble }
|
// { dg-do assemble }
|
// Origin: Loring Holden
|
// Origin: Loring Holden
|
|
|
template
|
template
|
class REFptr {
|
class REFptr {
|
public:
|
public:
|
virtual ~REFptr();
|
virtual ~REFptr();
|
REFptr &operator = (const REFptr& p);
|
REFptr &operator = (const REFptr& p);
|
};
|
};
|
|
|
class STR { };
|
class STR { };
|
class str_ptr : public REFptr { };
|
class str_ptr : public REFptr { };
|
|
|
template
|
template
|
class ARRAY {
|
class ARRAY {
|
protected:
|
protected:
|
T *_array;
|
T *_array;
|
int _num;
|
int _num;
|
int _max;
|
int _max;
|
public:
|
public:
|
virtual void realloc(int new_max) {
|
virtual void realloc(int new_max) {
|
_max = new_max;
|
_max = new_max;
|
T *tmp = new T [_max];
|
T *tmp = new T [_max];
|
if (tmp == 0) return;
|
if (tmp == 0) return;
|
for (int i=0; i<_num; i++) {
|
for (int i=0; i<_num; i++) {
|
tmp[i] = _array[i];
|
tmp[i] = _array[i];
|
}
|
}
|
delete [] _array;
|
delete [] _array;
|
_array = tmp;
|
_array = tmp;
|
}
|
}
|
};
|
};
|
|
|
int
|
int
|
main()
|
main()
|
{
|
{
|
ARRAY tags;
|
ARRAY tags;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.