When regularly writing textual output to buffers it may be more efficient for an application to only write non static parts between calls. Buffers can then be reused as often as necessary, saving the static text initialization cost.
This C++ 11 header-only library under MIT license attempts to provide such functionality.
The code is available on GitHub and code.malloc.fr.
-Wimplicit-fallthrough
workaroundIf a dependency to boost/config.hpp
is not a problem, be sure that it is included before bitset.hpp
, container.hpp
, string.hpp
, time.hpp
, number.hpp
, and date.hpp
.
Otherwise, define the macro BUFFER_HANDLE_FALLTHROUGH
to suit your specific needs. It defaults to the empty string for old compilers not enforcing the option but can be set, for instance, to [[fallthrough]]
for newer compilers.
Run make test
to compile and make run-test
to execute.
To change the path to those dependencies, create a config.mk
file and then assign the CATCH
and the BOOST
variables with the appropriate locations (‘.
’ is used by default).