Trailing Return Types -- sumi_cj

From the IBM C/C++ Cafe:

Introduction to the C++11 feature: trailing return types

by sumi_cj

From the article:

To solve this problem, C++11 introduced a feature called trailing return types. Using this feature, the previous program can be rewritten as follows:

template<class T>
auto mul(T a, T b) -> decltype(a*b){
    return a*b;
}

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.