C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Template syntax to 'auto' parameters
From: Phil Bouchard (phil_at_[hidden])
Date: 2020-03-06 23:36:52


Actually this could be extended for classes as well. Let's suppose:

struct A

{

 Â Â Â  auto i; // uninitialized

};

Same as:

template <typename T>

 Â Â Â  struct A

 Â Â Â  {

 Â Â Â      T i;

 Â Â Â  };

On 3/1/20 11:46 PM, Phil Bouchard wrote:
>
> All good then!
>
> On 3/1/20 11:44 PM, language.lawyer_at_[hidden] wrote:
>> On 02/03/2020 07:42, Phil Bouchard wrote:
>>> On 3/1/20 11:35 PM, language.lawyer_at_[hidden] wrote:
>>>> Are you proposing to add
>>>> http://eel.is/c++draft/dcl.decl#def:template,function,abbreviated ?
>>>>
>>>
>>> Similarly but I'm not sure why we would need the concept of
>>> "concepts"... A simple 'auto' keyword should suffice.
>>
>> It is not necessary to use concepts:
>>> For a placeholder-type-specifier of the form auto, the invented
>>> parameter is an unconstrained type-parameter.
>>
>>>> On 02/03/2020 07:26, Phil Bouchard via Std-Proposals wrote:
>>>>> Supposed we have the following syntax:
>>>>>
>>>>> template <typename T, typename U>
>>>>>
>>>>>      void foo(T t, U u)
>>>>>
>>>>>      {
>>>>>
>>>>>      }
>>>>>
>>>>>
>>>>> It could be simplified with:
>>>>>
>>>>>      void foo(auto t, auto u)
>>>>>
>>>>>      {
>>>>>
>>>>>      }
>>>>>
>>>>>
>>>>> (Please include my email in your replies)
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>>
> --
>
> *Phil Bouchard*
> Founder
> C.: (819) 328-4743
>
> Fornux Logo <http://www.fornux.com>

-- 
*Phil Bouchard*
Founder
C.: (819) 328-4743
Fornux Logo <http://www.fornux.com>


STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups