WPILibC++ 2024.3.2
wpi::ct_string< Char, Traits, N > Struct Template Reference

Fixed length string (array of character) for compile time use. More...

#include <wpi/ct_string.h>

Public Member Functions

template<size_t M>
requires (M <= (N + 1))
constexpr ct_string (Char const (&s)[M])
 
constexpr ct_string (std::basic_string_view< Char, Traits > s)
 
constexpr bool operator== (const ct_string< Char, Traits, N > &) const =default
 
constexpr bool operator== (const std::basic_string< Char, Traits > &rhs) const
 
constexpr bool operator== (std::basic_string_view< Char, Traits > rhs) const
 
template<size_t M>
requires (N + 1 == M)
constexpr bool operator== (Char const (&rhs)[M]) const
 
constexpr bool operator== (const Char *rhs) const
 
constexpr auto size () const noexcept
 
constexpr auto begin () const noexcept
 
constexpr auto end () const noexcept
 
constexpr auto data () const noexcept
 
constexpr auto c_str () const noexcept
 
constexpr operator std::basic_string< Char, Traits > () const noexcept
 
constexpr operator std::basic_string_view< Char, Traits > () const noexcept
 

Public Attributes

std::array< Char, N+1 > chars
 

Detailed Description

template<typename Char, typename Traits, size_t N>
requires (N < (std::numeric_limits<size_t>::max)())
struct wpi::ct_string< Char, Traits, N >

Fixed length string (array of character) for compile time use.

Template Parameters
Nnumber of characters
Charcharacter type
Traitscharacter traits

Constructor & Destructor Documentation

◆ ct_string() [1/2]

template<typename Char , typename Traits , size_t N>
template<size_t M>
requires (M <= (N + 1))
constexpr wpi::ct_string< Char, Traits, N >::ct_string ( Char const (&)  s[M])
inlineconstexpr

◆ ct_string() [2/2]

template<typename Char , typename Traits , size_t N>
constexpr wpi::ct_string< Char, Traits, N >::ct_string ( std::basic_string_view< Char, Traits >  s)
inlineexplicitconstexpr

Member Function Documentation

◆ begin()

template<typename Char , typename Traits , size_t N>
constexpr auto wpi::ct_string< Char, Traits, N >::begin ( ) const
inlineconstexprnoexcept

◆ c_str()

template<typename Char , typename Traits , size_t N>
constexpr auto wpi::ct_string< Char, Traits, N >::c_str ( ) const
inlineconstexprnoexcept

◆ data()

template<typename Char , typename Traits , size_t N>
constexpr auto wpi::ct_string< Char, Traits, N >::data ( ) const
inlineconstexprnoexcept

◆ end()

template<typename Char , typename Traits , size_t N>
constexpr auto wpi::ct_string< Char, Traits, N >::end ( ) const
inlineconstexprnoexcept

◆ operator std::basic_string< Char, Traits >()

template<typename Char , typename Traits , size_t N>
constexpr wpi::ct_string< Char, Traits, N >::operator std::basic_string< Char, Traits > ( ) const
inlineconstexprnoexcept

◆ operator std::basic_string_view< Char, Traits >()

template<typename Char , typename Traits , size_t N>
constexpr wpi::ct_string< Char, Traits, N >::operator std::basic_string_view< Char, Traits > ( ) const
inlineconstexprnoexcept

◆ operator==() [1/5]

template<typename Char , typename Traits , size_t N>
template<size_t M>
requires (N + 1 == M)
constexpr bool wpi::ct_string< Char, Traits, N >::operator== ( Char const (&)  rhs[M]) const
inlineconstexpr

◆ operator==() [2/5]

template<typename Char , typename Traits , size_t N>
constexpr bool wpi::ct_string< Char, Traits, N >::operator== ( const Char *  rhs) const
inlineconstexpr

◆ operator==() [3/5]

template<typename Char , typename Traits , size_t N>
constexpr bool wpi::ct_string< Char, Traits, N >::operator== ( const ct_string< Char, Traits, N > &  ) const
constexprdefault

◆ operator==() [4/5]

template<typename Char , typename Traits , size_t N>
constexpr bool wpi::ct_string< Char, Traits, N >::operator== ( const std::basic_string< Char, Traits > &  rhs) const
inlineconstexpr

◆ operator==() [5/5]

template<typename Char , typename Traits , size_t N>
constexpr bool wpi::ct_string< Char, Traits, N >::operator== ( std::basic_string_view< Char, Traits >  rhs) const
inlineconstexpr

◆ size()

template<typename Char , typename Traits , size_t N>
constexpr auto wpi::ct_string< Char, Traits, N >::size ( ) const
inlineconstexprnoexcept

Member Data Documentation

◆ chars

template<typename Char , typename Traits , size_t N>
std::array<Char, N + 1> wpi::ct_string< Char, Traits, N >::chars

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