Don't automatically use auto parameters in C++ -- Lesley Lai

Save to:
Instapaper Pocket Readability

Should we use almost always auto parameters?

Don't automatically use auto parameters in C++

by Lesley Lai

From the article:

Since C++14, we can create lambda expressions that take auto parameters. C++20 generalizes this idea by allowing us to do the same thing for regular functions. With this feature's advent, the programming style where all parameters are auto becomes popular among some C++ programmers. However, I think we should not use it if we had to. The more specific the type of the parameter is, the better.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.