C++ Logo

std-proposals

Advanced search

Re: Fixing some initialization gotchas

From: Maciej Cencora <m.cencora_at_[hidden]>
Date: Thu, 22 Aug 2019 22:56:11 +0200
And what were LEWG arguments for saying no here?

czw., 22 sie 2019 o 22:55 Tony V E <tvaneerd_at_[hidden]> napisał(a):

>
>
> On Thu, Aug 22, 2019 at 4:46 PM Maciej Cencora via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> Yes.
>>
>> After all you are explicit about the return type of the function (you
>> specified it in function definition), so why would you not want this to
>> work? There is no possibility for amibiguity here.
>>
>> czw., 22 sie 2019 o 22:36 sdkrystian via Std-Proposals <
>> std-proposals_at_[hidden]> napisał(a):
>>
>>> So you propose that this should be well formed?
>>>
>>> struct S { explicit operator int() { return 42; } };
>>>
>>> int f()
>>> {
>>> return { S() };
>>> }
>>>
>>>
> Having explicit work here has been voted on by the committee in the past,
> and LEWG strongly said No.
>
>
> --
> Be seeing you,
> Tony
>

Received on 2019-08-22 15:58:25