string_literal.h Source File
|
CPP API
|
string_literal.h
Go to the documentation of this file.
140 // Deduction guide to help the compiler with setting the correct size, i.e. not counting the terminating '\0' char.
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
StringLiteral(const char(&string)[Size]) -> StringLiteral< Size - 1 >
Wrapper for string literals, that allows passing them as template arguments. Should be used with cons...
Definition: string_literal.h:32
constexpr string_view_type string_view() const
Get a string_view of this literal. Be mindful of the lifetime of the view object.
Definition: string_literal.h:83
constexpr friend auto operator+(const StringLiteral &left, const StringLiteral< N > &right)
Join two literals.
Definition: string_literal.h:95
static constexpr size_type size()
The length of the StringLiteral (not counting the trailing '\0').
Definition: string_literal.h:40
value_type value[size()+1]
Contains the actual characters. Access this through data() or string_view().
Definition: string_literal.h:137
constexpr const_pointer data() const
Access the underlying array.
Definition: string_literal.h:71
constexpr friend auto operator==(const StringLiteral &left, const value_type(&right)[N])
Compare two literals.
Definition: string_literal.h:130
constexpr friend auto operator+(const StringLiteral &left, const value_type(&right)[N])
Join two literals.
Definition: string_literal.h:105
constexpr StringLiteral(const value_type(&string_literal)[size()+1])
Construct a StringLiteral.
Definition: string_literal.h:50
constexpr friend auto operator+(const value_type(&left)[N], const StringLiteral &right)
Join two literals.
Definition: string_literal.h:111
constexpr pointer data()
Access the underlying array. Modification is only possible during compile time.
Definition: string_literal.h:65
constexpr friend auto operator==(const StringLiteral &left, const StringLiteral< N > &right)
Compare two literals.
Definition: string_literal.h:125
constexpr bool empty() const
Check whether the StringLiteral is empty.
Definition: string_literal.h:59
std::basic_string_view< value_type > string_view_type
Definition: string_literal.h:37
constexpr StringLiteral()=default
Create a string filled with '\0'. Mainly used by StringLiteral internally.
Generated by