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

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

 



2008/7/21 Wesley Smith <wesley.hoke@xxxxxxxxx>:
> Hi,
> I've encountered a problem in GCC 4.2.3 that didn't exist in GCC
> 4.0.x.  Let's say I have:
>
> template<class T>
> Tube{
> public:
>    Tube();
>    ~Tube();
> };
>
> struct Graph {
>   Tube<Ugen> t;
> }
>
> struct Clock {
>   Graph g;
> }
>
> At issue is that Tube<T>'s constructor isn't getting called when Clock
> is allocated on the stack.  Is this compliant with the C++ standard?
> I thought all classes had their constructors called when instantiated
> as an object even as members of structs.  Any ideas?

Can you give a complete program which shows your problem?

Chris

[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