Subject: Re: [boost] Boost.Conversion: functors namming
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-05-24 07:11:07
Vicente Botet wrote:
> Stewart, Robert wrote:
> > auto f(factory<short>(_1));
> > short const s(f(static_cast<long>(3)));
> > Your suggestions for the "factory" call are:
> > A. boost::make_converter_to<short>(_1)
> > B. boost::conversion::fp::convert_to<short>(_1)
> > C. boost::convert_to<short>(_1)
> > I definitely dislike B. A isn't bad, but it should be in the
> > boost::conversion namespace. C is very nice, but it should
> > be in the boost::conversion namespace. The introduction of
> > the placeholder is enough to signal that the result is a
> > Phoenix lambda.
> Even if C is the more elegant, to my taste, it introduce a
> dependency on Boost.Phonix even if functors are not used, and
> this is one thing I would like to avoid. So it seems that A is
> a best compromise.
That overload can be put into a separate header so it, and its dependency on Phoenix, is only visible when desired. <boost/conversion/functor.hpp>?
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk