|
You are here |
www.kuniga.me | ||
| | | | |
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... | |
| | | | |
brevzin.github.io
|
|
| | | | | I like a declarative approach to programming. Ben Deane has given several good talks on what declarative programming is (such as this one from CppNow 2018), and if you haven't seen them, you should. The idea is to try to write your logic using expressions and to make it correct by construction, rather than using statements and having to reason imperatively. | |
| | | | |
sdowney.org
|
|
| | | | | A Possible Technique constexpr bool g(int lhs, int rhs) { auto& op = partial_eq; return op.ne(lhs, rhs); } Compiler Explorer with Supporting Code A trait is defined as a template var... | |
| | | | |
ericniebler.com
|
|
| | | At GoingNative back in September, Andrei Alexandrescu posed an interesting question about API design and C++11 that has had me scratching my head for a month. It was about the design of std::getlin... | ||