lundi 27 mars 2017

Can one use parameter value in trailing return type syntax

Consider the minimal example:

template <int>
struct bar { };

int main() 
{
    [](auto i) -> bar<i> { return {}; };
}

Or even:

template <int>
struct bar {};

template <class I>
auto foo(I i) -> bar<i> {}

clang compiles both forms without problems but gcc find the usage invalid (ex. 1), (ex. 2)

Aucun commentaire:

Enregistrer un commentaire