Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
Qx::StringLiteral< N > Struct Template Reference

The StringLiteral template struct acts as a literal class type wrapper around a C-style string that effectively allows the string to be used as a non-type template parameter. More...

#include <qx/utility/qx-stringliteral.h>

Public Member Functions

constexpr StringLiteral (const char(&str)[N])
 

Public Attributes

char value [N]
 

Detailed Description

template<size_t N>
struct Qx::StringLiteral< N >
#include <qx/utility/qx-stringliteral.h>
#include <iostream>
template<Qx::StringLiteral S>
void printString() { std::cout << "The string is: " << S.value }
int main()
{
printString<"Hello World">();
return 0;
}

Constructor & Destructor Documentation

◆ StringLiteral()

template<size_t N>
Qx::StringLiteral< N >::StringLiteral ( const char(&) str[N])
inlineconstexpr

Wraps the C-Style string str of length N.

Member Data Documentation

◆ value

template<size_t N>
Qx::StringLiteral< N >::value

The wrapped C-Style string.


The documentation for this struct was generated from the following files: