public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Fine <johnsfine@verizon.net>
To: Wesley Smith <wesley.hoke@gmail.com>
Cc: GCC-help <gcc-help@gcc.gnu.org>
Subject: Re: struct->struct->class in C++ no constructor
Date: Mon, 21 Jul 2008 21:23:00 -0000	[thread overview]
Message-ID: <4884FD2C.7000105@verizon.net> (raw)
In-Reply-To: <1079b050807211401m71bd33a0hb1f91a8d0645d9ad@mail.gmail.com>

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?
>
>
>   

  parent reply	other threads:[~2008-07-21 21:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 21:14 Wesley Smith
2008-07-21 21:19 ` Chris Jefferson
2008-07-21 21:23 ` John Fine [this message]
2008-07-22 13:20   ` Wesley Smith
2008-07-23 10:58 ` Alexandre Oliva
2008-07-23 11:07 ` Eljay Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4884FD2C.7000105@verizon.net \
    --to=johnsfine@verizon.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=wesley.hoke@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).