Skip to content

Ethiraric/CompileString

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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<char, N + 1> (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.

About

A tiny header to manipulate "raw strings" in a `std::string` fashion at compile-time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published