4 ms·
It is a template parameter, they just use a global object of a particular type to select it, probably for easier defaulting. E.g. https://en.cppreference.com/w
by fourthark 8y ago
It is a template parameter, they just use a global object of a particular type to select it, probably for easier defaulting.
E.g. https://en.cppreference.com/w/cpp/experimental/reduce https://en.cppreference.com/w/cpp/experimental/reduce
- MichaelMoser123 8y agothanks, didn't notice the declaration - this way they can deduce the type without having to specify the template parameter directly in the call - and you don't have to pass an actual instance; clever. You never stop learning with c++ template<class T> void foo(T &&);