CTAD already does that since 20:

template <typename T>
struct foo {
   T x;
};
foo{5} //makes foo<int>

On Sat, Mar 7, 2020 at 5:36 AM Phil Bouchard via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

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@gmail.com wrote:
On 02/03/2020 07:42, Phil Bouchard wrote:
On 3/1/20 11:35 PM, language.lawyer@gmail.com 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
--

Phil Bouchard
Founder
C.: (819) 328-4743

Fornux Logo
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals