Hello,
I was writing a static bin2bin obfuscator and needed a way to generate dynamic stubs with little runtime overhead. First thought of Asmjit however its emitter was too bloated for my use case. I don't even need to load generated assembly code into a runtime environment which is not exactly the thing I want. So I made a single-header library to generate assembly code at compile time with the help of C++ templates. It is done by directly manipulating bytes of instruction opcodes, providing you a pure std::array. You can then disassemble these bytes with for example Zydis to preserve their properties as well. If you wish you can also generate instructions that take random registers as operands. More in depth usage is in the documentation file. I'll be updating it soon but for now it is sufficient. Thought that might be useful for some other people and decided to release it.
Here's the link:
https://github.com/0x1c1101/blazing_asm