user4618320
user4618320

Reputation: 1

decltype(auto) in new initializer?

In C++11 I can do the following just fine:

auto a = new auto{42};

But none of the following work in any compiler I've tried:

decltype(auto) a = new decltype(auto){42};
auto a = new decltype(auto){42};

How do I use decltype(auto) in a new initializer in C++11?

Upvotes: 0

Views: 102

Answers (1)

Telokis
Telokis

Reputation: 3389

decltype(auto) is a C++14 feature !

Upvotes: 5

Related Questions