summaryrefslogtreecommitdiffstats
path: root/libvtv/testsuite/template-list2.cc
blob: f8ec739b6d5112656e739736ab352b55620ca5d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#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;
}
OpenPOWER on IntegriCloud