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

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

 



Can you provide a complete example?

As you described it, the constructor should be called. But you haven't given enough information for anyone to duplicate the situation in which the constructor isn't called.

Was the definition of the constructor provided in the same compilation or was it external? If provided, how do you know it wasn't called (possibly inlined and optimized to the point that you wouldn't know)?

Wesley Smith wrote:

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?




[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