Why was the addition of trailing-return-types necessary in C++11?

后端 未结 2 571
一生所求
一生所求 2021-02-13 13:22

I\'ve finally started to read up on c++11 and I fail to understand why trailing-return-types are required.

I came across the following example, which is used to highligh

2条回答
  •  春和景丽
    2021-02-13 13:33

    Well one obvious problem is that it would open you up to loops.

    typedef decltype(lhs+lhs) foo;
    foo lhs;
    

提交回复
热议问题