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

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

 



Hi,
I had a breakpoint in the constructor, so I know it wasn't called.
Also had some print statements in there.  It's a non trivial function,
so it shouldn't be optimized out and I'm also building debug.  I'll
try and extract it from the project and post a concrete example.

thanks,
wes

On Mon, Jul 21, 2008 at 2:18 PM, John Fine <johnsfine@xxxxxxxxxxx> wrote:
> 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