[uuid] Confusing uuid_class example in documentation

http://beta.boost.org/doc/libs/1_42_0/libs/uuid/uuid.html#POD%20Efficien cies includes some example code for making a uuid_class from the struct uuid POD. I was confused to see the example uuid_class both derives from boost::uuids::uuid *and* provides operator boost::uuids::uuid() [const]. Aren't the conversion operators unnecessary, as a conversion function is never called to convert an object to a base class of that type (by 12.3.2 [class.conv.fct])? In fact the source file that the documentation references (e.g. at https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_43_0_beta1 /libs/uuid/test/test_uuid_class.cpp) doesn't include the conversion operators. I think the documentation should be updated to match. Cheers, Gareth ************************************************************************ The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony to be in compliance with Sony's global policies and standards

Hi Gareth, On Wed, 28 Apr 2010 08:58 +0100, "Sylvester-Bradley, Gareth" <Gareth.Sylvester-Bradley@eu.sony.com> wrote:
http://beta.boost.org/doc/libs/1_42_0/libs/uuid/uuid.html#POD%20Efficien cies includes some example code for making a uuid_class from the struct uuid POD.
I was confused to see the example uuid_class both derives from boost::uuids::uuid *and* provides operator boost::uuids::uuid() [const].
Aren't the conversion operators unnecessary, as a conversion function is never called to convert an object to a base class of that type (by 12.3.2 [class.conv.fct])?
In fact the source file that the documentation references (e.g. at https://svn.boost.org/trac/boost/browser/tags/release/Boost_1_43_0_beta1 /libs/uuid/test/test_uuid_class.cpp) doesn't include the conversion operators. I think the documentation should be updated to match.
Thanks very much. You are correct. The class does not need the conversion operators. I will update the documentation.
Cheers, Gareth
Regards, Andy.
participants (2)
-
Andy Tompkins
-
Sylvester-Bradley, Gareth