Some of my frequently copy-and-pasted code snippets. I hope they will also be helpful to you.
$ ./.githooks/install_hooks.shThe hooks will automatically generate this README file before commit.
- cmake
- args.zsh: Some frequently used cmake arguments.
- cpp
- assume.hpp: Provide additional information to compiler.
- assume_aligned.hpp: A C++ wrapper of
__builtin_assume_aligned. - cache_padded.cpp: An example showing that 128-byte alignment may outperform 64-byte alignment in some cases on Intel (but not on AMD).
- ctti.hpp: Get the name / hash of the given type in compile-time.
- endian.hpp: Some endian-ness utilities.
- histogram.hpp: C++ version of TurboHist, the fastest histogram construction.
- poor_mans_concept.cpp: An example of how to simulate concept before C++20.
- timer.hpp: Some simple timer implementations.
- unroll.hpp: Some unrolling utilities.
- vec_ext.hpp: Some vector extension utilities.
- python
- fill_pool.py: An example of how to fill a multi-processing / multi-threading pool with dependent tasks.
- quote.py: Add / remove quotes (escapes).
- rust
- serde_post.rs: An example of how to add post processing into
serde::Deserializewith minimum code. - serde_shorthand.rs: An example of how to add a shorthand for a struct in
serde. Shorter and cleaner than https://serde.rs/string-or-struct.html. - trait_alias_with_assoc_bound.rs: An example of how to implement trait aliases with associated type bounds.
- serde_post.rs: An example of how to add post processing into