Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethiraric/compilestring
A tiny header to manipulate "raw strings" in a `std::string` fashion at compile-time.
https://github.com/ethiraric/compilestring
compile-time cpp
Last synced: 22 days ago
JSON representation
A tiny header to manipulate "raw strings" in a `std::string` fashion at compile-time.
- Host: GitHub
- URL: https://github.com/ethiraric/compilestring
- Owner: Ethiraric
- License: mit
- Created: 2018-07-25T14:32:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-26T16:11:55.000Z (over 6 years ago)
- Last Synced: 2024-11-07T05:45:01.301Z (2 months ago)
- Topics: compile-time, cpp
- Language: C++
- Size: 95.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CompileString
A tiny header to manipulate "raw strings" in a `std::string` fashion at
compile-time.A `toString` function on integers is provided in its own header if needs be.
## How it works
`CompileString` is templated over the length of the string (`CompileString<4>`)
and holds a `std::array` (`N` being the length of the string, `+
1` to store the end-of-string character `\0`).In order to add two strings, you need to add their lengths and allocate a new
`array`. This means that the type returned by `operator+` is different from the
type of its 2 operands. A `CompileString` is only assignable to another if both
their lengths are the same.## Bugs and issues
Feel free to open an Issue or a Pull request.