|
You are here |
www.cplusplus.com | ||
| | | | |
www.foonathan.net
|
|
| | | | | Just like regular function parameters, template parameters can also have default parameters. For class templates, this behaves mostly just like default function arguments: if you pass fewer template arguments than required, default template arguments are used to fill the remaining places. However, for function templates, it gets more complicated as template parameters for functions can be deduced by the normal function arguments. This leads to some interesting side-effects. In particular, default argumen... | |
| | | | |
quuxplusone.github.io
|
|
| | | | | Via StackOverflow: Newcomers to C++20 Ranges are often surprised that some ranges cannot be "const-iterated." But it's true! template<std::ranges::range R> void foreach(const R& rg) { // Wrong! for (auto&& elt : rg) { } } | |
| | | | |
www.fluentcpp.com
|
|
| | | | | Variadic templates allow any number of template parameters of any type. In this article we see how to do a variadic number of parameters of the SAME type. | |
| | | | |
mpark.github.io
|
|
| | | The pitfall of eagerness of perfect forwarding. | ||