Re: struct->struct->class in C++ no constructor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wes,

Worked on my machine.  [See code below.]

Can you provide a compile-able example which illustrates the problem?

The example you provided was too abbreviated, and did not compile.

Thanks,
--Eljay

- - - -

#include <iostream>

template <typename T>
class Tube
{
public:
  Tube();
  ~Tube();
};

template <typename T>
Tube<T>::Tube()
{
  std::cerr << "Tube ctor\n";
}

template <typename T>
Tube<T>::~Tube()
{
  std::cerr << "Tube dtor\n";
}

typedef int Ugen;

struct Graph
{
  Tube<Ugen> t;
};

struct Clock
{
  Graph g;
};

void TestOnStack()
{
  Clock clock;
}

int main()
{
  TestOnStack();
}


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux