List:MySQL++« Previous MessageNext Message »
From:Kevin Regan Date:June 14 2009 5:26pm
Subject:RE: Why dynamic allocation for Option objects?
View as plain text  
By singleton, I meant that each type only had a single type_info object that is returned
for all objects of that type.

Thank you for confirming that, though. :-)

--Kevin
________________________________________
From: jonathan.wakely@stripped [jonathan.wakely@stripped] On Behalf Of Jonathan Wakely
[mysql@stripped]
Sent: Sunday, June 14, 2009 5:58 AM
To: Kevin Regan
Cc: plusplus@stripped
Subject: Re: Why dynamic allocation for Option objects?

2009/6/14 Kevin Regan:
> The change below seems to fix this.  I believe that the type_info object returned is
> a singleton that outlives the object, but I'm not 100% sure of that.  Can some C++ expert
> confirm this?

It's not a singleton - you can have any number of instances of the
type, with different values.  Otherwise every use of the typeid
operator would return the same result!

But the lifetime of the type_info object will last until the end of
the program, so your change is safe in that respect.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
Thread
Why dynamic allocation for Option objects?Kevin Regan6 Jun
  • Re: Why dynamic allocation for Option objects?Warren Young6 Jun
    • RE: Why dynamic allocation for Option objects?Kevin Regan11 Jun
      • Re: Why dynamic allocation for Option objects?Jonathan Wakely11 Jun
        • RE: Why dynamic allocation for Option objects?Kevin Regan13 Jun
          • RE: Why dynamic allocation for Option objects?Kevin Regan13 Jun
          • Re: Why dynamic allocation for Option objects?Jonathan Wakely13 Jun
            • RE: Why dynamic allocation for Option objects?Kevin Regan14 Jun
              • Re: Why dynamic allocation for Option objects?Jonathan Wakely14 Jun
                • RE: Why dynamic allocation for Option objects?Kevin Regan14 Jun
                  • Re: Why dynamic allocation for Option objects?Jonathan Wakely15 Jun
                    • RE: Why dynamic allocation for Option objects?Kevin Regan15 Jun
                      • Re: Why dynamic allocation for Option objects?Jonathan Wakely15 Jun
              • Re: Why dynamic allocation for Option objects?Warren Young16 Jun
        • Re: Why dynamic allocation for Option objects?Warren Young16 Jun