(Re-)Proposal: Allow explicit type conversion operators

28 views
Skip to first unread message

Peter Kasting

unread,
Feb 10, 2016, 11:40:20 PM2/10/16
to cxx
Now that Visual Studio 2015 has landed, my hope is to reconsider some of the features we banned until we had it, and I wanted to start with one with reasonable utility but fairly limited scope.

Explicit type conversion operators fit this bill.  They were initially discussed in https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/zGF1SrQ-1HQ .

There was some disagreement on that thread about the utility of these.  To be clear, these are useful in limited cases, and by far the most useful is explicit conversion to bool for things like our smart pointer types.  However, in those limited scopes, I think these can make code simpler and clearer.  It seemed like there was some indication that these may also allow functionality not easily expressible with C++03 constructs, but I'm not very clear on that.

PK

Scott Graham

unread,
Feb 11, 2016, 12:18:37 AM2/11/16
to Peter Kasting, cxx
These can of course be considered now, but unfortunately you'll have to hold off on any action (possibly for a month or two).

2015 has bounced a few times, and we may decide we have to wait for Visual Studio Update 2 now. (The current alternative is a custom packaged toolchain with at least 3 side-band patches from Microsoft support, which is getting a bit ugly, especially since goma has to have a matching patched toolchain. And we're not sure that will even be fully successful.)

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFB9KBRmz4mp1bbdPKNYL_-8dWgJwag50MsSqXCaJnmKbg%40mail.gmail.com.

Peter Kasting

unread,
Feb 11, 2016, 12:20:21 AM2/11/16
to Scott Graham, cxx
On Wed, Feb 10, 2016 at 9:18 PM, Scott Graham <sco...@chromium.org> wrote:
These can of course be considered now, but unfortunately you'll have to hold off on any action (possibly for a month or two).

OK, in the interests of saving people's time, let's suspend this thread immediately, and I'll resurrect it once 2015 has landed Really For Real.

PK 

Daniel Bratell

unread,
Feb 11, 2016, 4:53:11 AM2/11/16
to Peter Kasting, Scott Graham, cxx
On Thu, 11 Feb 2016 06:18:36 +0100, Scott Graham <sco...@chromium.org> wrote:

These can of course be considered now, but unfortunately you'll have to hold off on any action (possibly for a month or two).

2015 has bounced a few times, and we may decide we have to wait for Visual Studio Update 2 now. (The current alternative is a custom packaged toolchain with at least 3 side-band patches from Microsoft support, which is getting a bit ugly, especially since goma has to have a matching patched toolchain. And we're not sure that will even be fully successful.)

I don't know what fixes will be in those patches, but if they are really needed to build Chromium those patches will have to be available public as well which further complicates things.

/Daniel

-- 
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Jeremy Roman

unread,
Apr 12, 2016, 7:19:11 PM4/12/16
to Daniel Bratell, Peter Kasting, Scott Graham, cxx
Resurrecting this now that MSVC has officially stuck. I'd like to allow explicit conversion operators, most notably to replace the "safe bool" pattern we have in numerous places. Sample CL: https://codereview.chromium.org/1878253003

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.

Dana Jansens

unread,
Apr 12, 2016, 7:24:43 PM4/12/16
to Jeremy Roman, Daniel Bratell, Peter Kasting, Scott Graham, cxx
On Tue, Apr 12, 2016 at 4:19 PM, Jeremy Roman <jbr...@chromium.org> wrote:
Resurrecting this now that MSVC has officially stuck. I'd like to allow explicit conversion operators, most notably to replace the "safe bool" pattern we have in numerous places. Sample CL: https://codereview.chromium.org/1878253003

I think we want this and have no reason to delay now.
 

On Thu, Feb 11, 2016 at 4:53 AM, Daniel Bratell <bra...@opera.com> wrote:
On Thu, 11 Feb 2016 06:18:36 +0100, Scott Graham <sco...@chromium.org> wrote:

These can of course be considered now, but unfortunately you'll have to hold off on any action (possibly for a month or two).

2015 has bounced a few times, and we may decide we have to wait for Visual Studio Update 2 now. (The current alternative is a custom packaged toolchain with at least 3 side-band patches from Microsoft support, which is getting a bit ugly, especially since goma has to have a matching patched toolchain. And we're not sure that will even be fully successful.)

I don't know what fixes will be in those patches, but if they are really needed to build Chromium those patches will have to be available public as well which further complicates things.

/Daniel

-- 
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/op.ycnxqowkrbppqq%40cicero2.linkoping.osa.

--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.

Jeremy Roman

unread,
Apr 13, 2016, 1:43:10 PM4/13/16
to Dana Jansens, Daniel Bratell, Peter Kasting, Scott Graham, cxx
Reply all
Reply to author
Forward
0 new messages