mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-28 05:51:04 +00:00
47 lines
611 B
C++
47 lines
611 B
C++
// { dg-do run }
|
|
|
|
#include <assert.h>
|
|
|
|
extern "C" int printf(const char *, ...);
|
|
|
|
class Subscriptor
|
|
{
|
|
public:
|
|
|
|
Subscriptor()
|
|
{ counter = 1;}
|
|
|
|
virtual ~Subscriptor()
|
|
{
|
|
counter--;
|
|
assert(counter == 0);
|
|
}
|
|
|
|
private:
|
|
static int counter;
|
|
};
|
|
|
|
int Subscriptor::counter;
|
|
|
|
template <typename number>
|
|
class Polynomial : public Subscriptor
|
|
{
|
|
};
|
|
|
|
class LagrangeEquidistant: public Polynomial<double>
|
|
{
|
|
};
|
|
|
|
template<typename _Tp>
|
|
inline void
|
|
_MyDestroy(_Tp* __pointer)
|
|
{ __pointer->~_Tp(); }
|
|
|
|
int main()
|
|
{
|
|
LagrangeEquidistant * s1 = new LagrangeEquidistant;
|
|
_MyDestroy(s1);
|
|
|
|
return 0;
|
|
}
|