Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-03-27 10:18:29


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>> As described on the rationale page of the documentation, the primary
>> reason I'm using copy-on-write is that move semantics aren't widely
>> available yet. Portability is one of my primary goals, and while I've
>> seen references to a move-semantics-emulator in Boost, I've also seen
>> suggestions that it relies on the compiler to somehow recognize it. That
>> doesn't sound fully portable to me.
>
> Have you looked at the (proposed) Boost.Move library by Ion (available
> from the sandbox)?

> It does a pretty good job of emulating move semantics for compilers
> that lack rvalue references.

No, I wasn't aware of its existence. I haven't seen it mentioned on this
list in the last couple weeks, is it under review for official acceptance?

If not, no offense, but I can't use it. I'll be happy to do so when it's
an official part of the Boost library though.

> Not sure what you're referring to by "suggestions that it relies on
> the compiler to somehow recognize it"...can you elaborate?

I finally tracked down the reference. From the "Thread Management"
documentation page of Boost.Thread:

- ------------------------8<-----------------------
Objects of type boost::thread are movable, however, so they can be
stored in move-aware containers, and returned from functions. [...]

[Note: On compilers that support rvalue references, boost::thread
provides a proper move constructor and move-assignment operator, and
therefore meets the C++0x MoveConstructible and MoveAssignable
concepts. With such compilers, boost::thread can therefore be used with
containers that support those concepts.

For other compilers, move support is provided with a move emulation
layer, so containers must explicitly detect that move emulation layer.
See <boost/thread/detail/move.hpp> for details.]
- ------------------------8<-----------------------

I misremembered it slightly, but the general argument still stands: move
semantics aren't widely available yet, so the copy-on-write behavior of
XInt is necessary for now.
- --
Chad Nelson
Oak Circle Software, Inc.
*
*
*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuuE7UACgkQp9x9jeZ9/wQ80wCdFUWFSNPngv5BpocWnbml+mPZ
gVsAoO6hMycPIp/h8zFgmnSG48emMonL
=V0vo
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk