C++ Logo

std-proposals

Advanced search

Argument deduction for non-static class members

From: Phil Bouchard <boost_at_[hidden]>
Date: Sat, 20 Mar 2021 00:52:52 -0400
Why is that disallowed when you can simply workaround the problem?

#include <iostream>
#include <list>

using namespace std;

struct A
{
     decltype(list{1, 2, 3, 4, 5, 6}) l = list{1, 2, 3, 4, 5, 6};
};

int main()
{
     A a;

     for (auto i = a.l.begin(); i != a.l.end(); ++ i)
         cout << * i << ", ";

     cout << endl;
}



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

Received on 2021-03-19 23:53:00