9 #ifndef EMP_CE_STRING_H 10 #define EMP_CE_STRING_H 13 #include <type_traits> 15 #include "../tools/functions.h" 21 using size_t = std::size_t;
27 constexpr
bool IsEqual(
const ce_string & in,
size_t first=0)
const {
28 return (m_size == in.m_size) &&
29 ((m_size == first) || (m_str[first] == in.m_str[first] && IsEqual(in, first+1)));
31 constexpr
bool IsLess(
const ce_string & in,
size_t first=0)
const {
32 return (first == in.m_size) ?
false :
33 ((first == m_size) || (m_str[first] < in.m_str[first] || IsLess(in, first+1)));
37 constexpr
ce_string(
const char (&in)[N]) : m_str(in), m_size(N-1) { ; }
47 constexpr
size_t size()
const {
return m_size; }
54 operator std::string()
const {
return std::string(m_str); }
55 std::string
ToString()
const {
return std::string(m_str); }
constexpr bool operator>=(const ce_string &in) const
Definition: ce_string.h:45
constexpr ce_string(const char(&in)[N])
Definition: ce_string.h:37
constexpr bool operator>(const ce_string &in) const
Definition: ce_string.h:43
constexpr bool operator<(const ce_string &in) const
Definition: ce_string.h:42
constexpr char operator[](const size_t pos) const
Definition: ce_string.h:49
std::string ToString() const
Definition: ce_string.h:55
If we are in emscripten, make sure to include the header.
Definition: array.h:37
constexpr bool operator<=(const ce_string &in) const
Definition: ce_string.h:44
constexpr bool operator==(const ce_string &in) const
Definition: ce_string.h:40
constexpr size_t size() const
Definition: ce_string.h:47
constexpr bool operator!=(const ce_string &in) const
Definition: ce_string.h:41
Definition: ce_string.h:19