|
|
|
|
|
by allo37
1243 days ago
|
|
I do this quite a bit in C and C++; I find it's a great way to reduce the mental effort required to understand a long function without having to jump around the source like when it is broken up into multiple functions. In C++ you can really (ab)use it to do things like scoped mutex locks and "stopwatches" that start a timer on construction and print the elapsed time on destruction. Some people find it a bit bizarre though, to each his/her own I guess. |
|