Boost logo

Boost :

Subject: Re: [boost] Heads up - string_ref landing
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-11-27 14:09:57


On 26/11/12 13:52, Daniel James wrote:
> On 26 November 2012 11:56, Andrey Semashev <andrey.semashev_at_[hidden]> wrote:
>> The problem with std::string is the same as with string_ref - it
>> doesn't support implicit construction from an arbitrary range, so my
>> examples with custom string types would still not work.
>
> Shouldn't construction from an arbitrary range be explicit? Arbitrary
> implicit conversions are problematic. To get implicit construction
> from third party strings, I'd use some sort of explicit customisation
> mechanism.

I never understood what problems people had with implicit conversion.
Sure, a template implicit conversion operator is dangerous, but all
other uses, in particular implicit constructors, have no problem really.


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