Speclib  0.1.2
The library for writing better CUDA libraries

Strings in the type system. More...

Macros

#define STATIC_STRING(STR)    decltype(sp::staticString([](){return STR;}, sp::make_int_sequence<sizeof(STR)/sp::CharBytes<decltype(STR)> - 1>{}))
 Define a type-encoded string. More...
 

Detailed Description

Strings in the type system.

See also
sp::c::String for constexpr dynamically-allocated strings. If you want to do Strings processing inside a constexpr function that runs at compile-time (instead of in types) that is usually more convenient.

Macro Definition Documentation

◆ STATIC_STRING

#define STATIC_STRING (   STR)     decltype(sp::staticString([](){return STR;}, sp::make_int_sequence<sizeof(STR)/sp::CharBytes<decltype(STR)> - 1>{}))

Define a type-encoded string.

Type-encoded strings are represented as a char.... This macro is a convenient way of mapping between a string literal and the appropriate char..., where char is replaced with the appropriate character type.

using FooStr = STATIC_STRING("foo") // Produces the string `f', 'o', 'o'
using FooStr = STATIC_STRING(U"foo") // Produces the same string, but encoded using char32_t.
#define STATIC_STRING(STR)
Define a type-encoded string.
Definition: StaticString.hpp:52