Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
https://github.com/copperspice/cs_libguarded#cslibguarded
My lock_ios iostream manipulator is similar in the mutex aspect. This use-case works well because it's typical to write one line of output per statement, and contention is usually a corner case in logging.
About the fact of calling a function taken as a parameter I already did something similar few years ago. Note that the Core Guidelines says it is a bad idea to do it and explains why.
Facebook's folly library has had it as well, since at least 2014 if not earlier, although it's now deprecated in favor of named functions.