Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2000-11-06 09:28:12


From: "Gary Powell" <Gary.Powell_at_[hidden]>

> namespace std {
> void swap(boost::any & lhs, boost::any & rhs) { lhs.swap(rhs); }
> }
>
> Reasoning: If you are going to provide an optimized swap you should let
the
> namespace std know about it.
>
> I think this is a legal overload.

No, at least not yet.

> (Feel free to cite chapter and verse for
> why not.)

17.4.3.1/1.

> I tried to search the history for "any" and comparisons, and thanks to the
> frequent use of the word "any" it was more work that it was worth. So I
hope
> not to start a chain of "We discussed this in April and rejected it
because"
> discussions, was there any discussion of whether any should provide the
> operator==() and operator>() ? I was thinking about forwarding the
> comparisons to the native types and letting it either compile or not.
> (Depending on whether the types had the necessary operations.)

Well, actually, we did discuss this in length without reaching an agreement.
:-)

--
My own comments about any:
* MSVC_INCLUDE(template<>) is unnecessary in two places; removing it would
make the code clearer.
* The implicit conversion to void* still causes comparisons on anys to
compile.
--
Peter Dimov
Multi Media Ltd.

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