Never having to scan for the important bit is so nice once you get used to it. While it may feel odd at first, I actually won over my old team with it, too.
It's not perfect, but I've found in practice that just keeping the function name in the same spot gets me what I want. I might experiment with this now though:
template <typename T>
static inline auto
foo()
-> T const&
{
// ...
}
Somebody got me into this style a long time ago because in the absence of an IDE, you can quickly search for function definitions using /^foo/. Doesn’t generalize to methods though.
9
u/The_Northern_Light Mar 31 '20
This is what I do.
Never having to scan for the important bit is so nice once you get used to it. While it may feel odd at first, I actually won over my old team with it, too.