cppden / ctstring

Compile-Time String

Repository from Github https://github.comcppden/ctstringRepository from Github https://github.comcppden/ctstring

Build Status Coverage Status license

ctstring

Compile-Time String

Strings at compile-time

Strings can be used for anything at compile-time, e.g. for hash calculation or matching:

auto sample1 = "Hello"_chars;
auto sample2 = "Hello"_ichars;
char constexpr csz[] = "hello world";
static_assert(!sample1.match(csz, csz+sizeof(csz)), "");
static_assert(sample2.match(csz, csz+sizeof(csz)), "");

Obfuscated strings

Obfuscate strings in compiled binary to hide sensitive data:

auto const xsHidden = "Farewell: this won't be seen in binary!"_xchars;
std::cout << "hidden: " << xsHidden.str().c_str() << std::endl;

About

Compile-Time String

License:MIT License


Languages

Language:C++ 85.3%Language:CMake 10.4%Language:Shell 4.3%