Topic: [c++std-ext-15200] An implementation of N4035
Author: "Dr. Peter Gottschling" <peter.gottschling@tu-dresden.de>
Date: Mon, 07 Jul 2014 16:45:47 +0200
Raw View
Thank you so much Faisal!
This is really great to have this feature publicly available (in
addition to Daveed's first implementation).
I will spend some time playing with it later this week.
Best wishes and thanks again,
Peter
Am 06.07.2014 20:36, schrieb Faisal Vali:
> Here you go Peter - per our discussion in Rapperswil - an
> implementation to play with in clang:
>
> https://github.com/faisalv/clang/tree/using-auto
>
> To see a sample of what compiles:
> https://github.com/faisalv/clang/blob/using-auto/test/SemaCXX/cxx1z-auto-alias.cpp
>
> Hopefully - maybe playing around with the implementation might inform
> further discussion and perhaps facilitate convergence towards an
> eventual design that seems right for C++ users - or acknowledgment
> that the design space might need to be radically revisited.
>
> To highlight features of this patch as they might differ from N4035:
> - auto-aliases only kick in for variable declarations and 'auto'
> function returns (not during template argument deduction of any other
> sort, such as generic lambdas etc).
> - currently allowed in unions
> - not allowed for decltype(auto)
> - do not trigger explicit conversions
>
> EWG's current stance: http://isocpp.org/files/papers/N4101.html#76
>
> Hope this helps Peter!
>
> Faisal Vali
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Faisal Vali <faisalv@gmail.com>
Date: Tue, 8 Jul 2014 18:27:49 -0500
Raw View
Peter,
Richard Smith pointed out that the more intuitive specification for
your feature
is to consider a conversion to the <type-id> specified by the 'using auto'.
So instead of
struct X {
using auto = <type-id>;
...
};
auto& x = X{};
being transformed into: <type-id>&x = X{};
The more intuitive transformation is into: auto& x = static_cast<type-id>(X{});
So should you want to play with those semantics - here you go:
https://github.com/faisalv/clang/commits/using-auto-conv
The original branch still implements the other approach.
On Mon, Jul 7, 2014 at 9:45 AM, Dr. Peter Gottschling
<peter.gottschling@tu-dresden.de> wrote:
> Thank you so much Faisal!
>
> This is really great to have this feature publicly available (in addition to
> Daveed's first implementation).
>
> I will spend some time playing with it later this week.
>
> Best wishes and thanks again,
>
> Peter
>
> Am 06.07.2014 20:36, schrieb Faisal Vali:
>
>> Here you go Peter - per our discussion in Rapperswil - an
>> implementation to play with in clang:
>>
>> https://github.com/faisalv/clang/tree/using-auto
>>
>> To see a sample of what compiles:
>>
>> https://github.com/faisalv/clang/blob/using-auto/test/SemaCXX/cxx1z-auto-alias.cpp
>>
>> Hopefully - maybe playing around with the implementation might inform
>> further discussion and perhaps facilitate convergence towards an
>> eventual design that seems right for C++ users - or acknowledgment
>> that the design space might need to be radically revisited.
>>
>> To highlight features of this patch as they might differ from N4035:
>> - auto-aliases only kick in for variable declarations and 'auto'
>> function returns (not during template argument deduction of any other
>> sort, such as generic lambdas etc).
>> - currently allowed in unions
>> - not allowed for decltype(auto)
>> - do not trigger explicit conversions
>>
>> EWG's current stance: http://isocpp.org/files/papers/N4101.html#76
>>
>> Hope this helps Peter!
>>
>> Faisal Vali
>>
>
> --
>
> --- You received this message because you are subscribed to the Google
> Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.