Skip to content

A compile time library for manipulating template argument characters.

License

Notifications You must be signed in to change notification settings

seppeon/Templated-Compile-Time-Strings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

A compile time single header string manipulation library. Used for building static strings at compile time. For where template char arguments are more convient than the C++20 constexpr string.

Define your symbols as static constexpr variables.

Example:

constexpr auto a = CreateCharList<'h', 'e', 'l', 'l', 'o'>{};
constexpr auto b = CreateCharList<'='>{};
constexpr auto c = CreateCharList<1234>{};
constexpr auto d = CreateCharList<',', 5678>{};
constexpr auto ab = a.Append(b);
constexpr auto abc = ab.Append(c);
constexpr auto abc_str = ToStringView(abc.Append(d));
std::cout.write(std::data(abc_str), std::size(abc_str));

Results in:

hello=1234,5678

Extracted from a dimensional analysis library for building static strings of the units.

About

A compile time library for manipulating template argument characters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages