relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
relx::schema::fixed_string< N > Struct Template Reference

Compile-time string type that can be used as template non-type parameter in C++20. More...

#include <relx/schema/fixed_string.hpp>

Public Member Functions

constexpr fixed_string (const char(&str)[N])
 
constexpr fixed_string (const fixed_string &)=default
 
constexpr operator std::string_view () const
 
constexpr const char * c_str () const
 
constexpr std::size_t size () const
 
constexpr bool empty () const
 
template<std::size_t M>
constexpr bool operator== (const fixed_string< M > &other) const
 
template<std::size_t M>
constexpr bool operator!= (const fixed_string< M > &other) const
 

Public Attributes

char value [N]
 

Detailed Description

template<std::size_t N>
struct relx::schema::fixed_string< N >

Compile-time string type that can be used as template non-type parameter in C++20.

This implementation allows usage like:

struct Users { static constexpr auto table_name = "users"; relx::schema::column<"id", int> id; relx::schema::column<"name", std::string> name; relx::schema::column<"email", std::string> email; };

Definition at line 25 of file fixed_string.hpp.

Constructor & Destructor Documentation

◆ fixed_string() [1/2]

template<std::size_t N>
constexpr relx::schema::fixed_string< N >::fixed_string ( const char(&)  str[N])
inlineconstexpr

Definition at line 26 of file fixed_string.hpp.

◆ fixed_string() [2/2]

template<std::size_t N>
constexpr relx::schema::fixed_string< N >::fixed_string ( const fixed_string< N > &  )
constexprdefault

Member Function Documentation

◆ c_str()

template<std::size_t N>
constexpr const char * relx::schema::fixed_string< N >::c_str ( ) const
inlineconstexpr

Definition at line 36 of file fixed_string.hpp.

◆ empty()

template<std::size_t N>
constexpr bool relx::schema::fixed_string< N >::empty ( ) const
inlineconstexpr

Definition at line 42 of file fixed_string.hpp.

◆ operator std::string_view()

template<std::size_t N>
constexpr relx::schema::fixed_string< N >::operator std::string_view ( ) const
inlineconstexpr

Definition at line 32 of file fixed_string.hpp.

◆ operator!=()

template<std::size_t N>
template<std::size_t M>
constexpr bool relx::schema::fixed_string< N >::operator!= ( const fixed_string< M > &  other) const
inlineconstexpr

Definition at line 50 of file fixed_string.hpp.

◆ operator==()

template<std::size_t N>
template<std::size_t M>
constexpr bool relx::schema::fixed_string< N >::operator== ( const fixed_string< M > &  other) const
inlineconstexpr

Definition at line 45 of file fixed_string.hpp.

◆ size()

template<std::size_t N>
constexpr std::size_t relx::schema::fixed_string< N >::size ( ) const
inlineconstexpr

Definition at line 38 of file fixed_string.hpp.

Member Data Documentation

◆ value

template<std::size_t N>
char relx::schema::fixed_string< N >::value[N]

Definition at line 30 of file fixed_string.hpp.


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