ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: Re: Mini-review request: aligned_storage.hpp
by Itay Maman other posts by this author
Aug 9 2002 11:31AM messages near this date
RE: [boost] Re: Mini-review request: aligned_storage.hpp | Re: [boost] Re: Mini-review request: aligned_storage.hpp
Anthony Williams wrote in a message:
> 
> I've just had a thought about how to implement the strong guarantee for
variant, at the expense of larger space requirements --- have *two* copies
of > the internals, with a flag to indicate which is valid. Then, when
swapping or assigning, copy construct the value from the other variant into
the unused > space, and destruct the original and switch the flag when
everything is done.
> 
> What do people think?
> 
> Anthony
> 


I don't think it is possible - in the general case - to create two identical
instances of a class.
Consider this class:

// Just another class
struct jac
{
    jac* inst_p_;
    int n_;

   jac(int n = 0)  : n_(n)
   {
     inst_p_ = this;
   }

   jac(const jac& other) : n_(other.n_)


      inst_p_ = this;
   }

   jac* get() { return inst_p_; }
   void set(jac* inst_p) { inst_p_ = inst_p; }
} ;




--
Itay Maman
    itay_maman@[...].com
    maman@[...].com

This message expresses my personal opinion.




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Fernando Cacciola
Eric Friedman
Fernando Cacciola
Douglas Gregor
Fernando Cacciola
Douglas Gregor
Itay Maman
David Abrahams
Eric Friedman
Itay Maman
Fernando Cacciola
David Abrahams
Eric Friedman
Douglas Gregor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved