Abseil C++#

Purpose#

  • Parse command-line flags

  • Development tools and libraries

Motivation#

  • The command-line flags parser allows the use of a flagfile

    • For example, it is useful to save login credentials in an appropriately permissioned file to avoid leaking secrets through /proc/cmdline

  • Containers has better performance compared to the standard library

    • For example, absl::flat_hash_map has better cache-locality compared to std::unordered_map

    Warning

    The ABI depends on debug mode and whether the sanitizer compiler flag has been used. The libabseil package that we can download from conda-forge has been built in release mode. It is therefore possible to experience crashes if you’re testing in debug mode. If you’re looking for an alternative, perhaps check unordered_dense.

  • The library is open-source, well maintained, of high quality, and well documented

Flags#

Use underscore to separate words

Correct
--foo_bar 123
Wrong
--foo-bar 123

A flagfile can be used (note assignment is required)

echo << EOF > flags.cfg
--foo_bar=123
EOF

some-app --flagfile flags.cfg