[utility] boost::initialized_value added to value_init.hpp (release)

FYI, I just merged value_init from the trunk to the release branch: http://svn.boost.org/trac/boost/changeset/46464 It now has a little const object, boost::initialized_value, that has a generic conversion operator, so that one can initialize any CopyConstructible, DefaultConstructible type of object as follows: T obj = boost::initialized_value; boost::initialized_value provides a workaround to compilers that haven't yet fully implemented value-initialization. Including compiler versions from MSVC, Borland, Sun, and GCC: http://svn.boost.org/trac/boost/browser/branches/release/libs/utility/value_... For example, suppose your class Foo has all its data stored in a simple aggregate struct, called Bar: class Foo { Bar m_bar; public: Foo(); }; struct Bar { std::string s; int i; }; The default constructor of Foo would typically want to value-initialize its data: Foo::Foo() : m_bar() // Value-initialization. { } This may not work properly, because of those aforementioned compiler issues. (Bar::i may be left uninitialized!) So instead, boost::initialized_value could be of help: Foo::Foo() : m_bar( boost::initialized_value ) // Works fine :-) { } boost::initialized_value is in fact just an extra convenience feature of the template boost::value_initialized<T>, by Fernando Cacciola. So Fernando and I agreed to add initialized_value to <utility/value_init.hpp> Kind regards, -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center

Niels Dekker - mail address until 2008-12-31 skrev:
FYI, I just merged value_init from the trunk to the release branch: http://svn.boost.org/trac/boost/changeset/46464
Maybe I missed something, but I thought trunk formed the basis of the release branch for each new release? If not, do I manually have to merge all my changes from trunk into the release branch? Thanks -Thorsten

Thorsten Ottosen wrote:
Niels Dekker - mail address until 2008-12-31 skrev:
FYI, I just merged value_init from the trunk to the release branch: http://svn.boost.org/trac/boost/changeset/46464
Maybe I missed something, but I thought trunk formed the basis of the release branch for each new release?
If by basis you mean that the release will branch off from the trunk then I guess you missed something. :-) See the handy calendar I put up on the web site for reference <http://www.boost.org/community/index.html>. Note, according to those dates today is the last day to merge stable changes to the release branch.
If not, do I manually have to merge all my changes from trunk into the release branch?
Yes, AFAIK. Beman? -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org (msn) - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail

AMDG Rene Rivera wrote:
If by basis you mean that the release will branch off from the trunk then I guess you missed something. :-) See the handy calendar I put up on the web site for reference <http://www.boost.org/community/index.html>. Note, according to those dates today is the last day to merge stable changes to the release branch.
Does this mean that I just missed the release for Units? In Christ, Steven Watanabe

Steven Watanabe wrote:
Rene Rivera wrote:
If by basis you mean that the release will branch off from the trunk then I guess you missed something. :-) See the handy calendar I put up on the web site for reference <http://www.boost.org/community/index.html>. Note, according to those dates today is the last day to merge stable changes to the release branch.
Does this mean that I just missed the release for Units?
I hope not! Yikes, I have a lot of changes to get into the release branch, including all of accumulators. Looks like it'll be a late night. -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (5)
-
Eric Niebler
-
Niels Dekker - mail address until 2008-12-31
-
Rene Rivera
-
Steven Watanabe
-
Thorsten Ottosen