1 #ifndef _C4_STD_VECTOR_HPP_
2 #define _C4_STD_VECTOR_HPP_
9 #ifndef C4CORE_SINGLE_HEADER
23 char *data = vec.empty() ? nullptr : vec.data();
24 return c4::substr(data, vec.size());
29 c4::csubstr
to_csubstr(std::vector<char, Alloc>
const& vec)
31 const char *data = vec.empty() ? nullptr : vec.data();
32 return c4::csubstr(data, vec.size());
38 template<
class Alloc> C4_ALWAYS_INLINE
bool operator!= (c4::csubstr ss, std::vector<char, Alloc>
const& s) {
return ss !=
to_csubstr(s); }
39 template<
class Alloc> C4_ALWAYS_INLINE
bool operator== (c4::csubstr ss, std::vector<char, Alloc>
const& s) {
return ss ==
to_csubstr(s); }
40 template<
class Alloc> C4_ALWAYS_INLINE
bool operator>= (c4::csubstr ss, std::vector<char, Alloc>
const& s) {
return ss >=
to_csubstr(s); }
41 template<
class Alloc> C4_ALWAYS_INLINE
bool operator> (c4::csubstr ss, std::vector<char, Alloc>
const& s) {
return ss >
to_csubstr(s); }
42 template<
class Alloc> C4_ALWAYS_INLINE
bool operator<= (c4::csubstr ss, std::vector<char, Alloc>
const& s) {
return ss <=
to_csubstr(s); }
43 template<
class Alloc> C4_ALWAYS_INLINE
bool operator< (c4::csubstr ss, std::vector<char, Alloc>
const& s) {
return ss <
to_csubstr(s); }
45 template<
class Alloc> C4_ALWAYS_INLINE
bool operator!= (std::vector<char, Alloc>
const& s, c4::csubstr ss) {
return ss !=
to_csubstr(s); }
46 template<
class Alloc> C4_ALWAYS_INLINE
bool operator== (std::vector<char, Alloc>
const& s, c4::csubstr ss) {
return ss ==
to_csubstr(s); }
47 template<
class Alloc> C4_ALWAYS_INLINE
bool operator>= (std::vector<char, Alloc>
const& s, c4::csubstr ss) {
return ss <=
to_csubstr(s); }
48 template<
class Alloc> C4_ALWAYS_INLINE
bool operator> (std::vector<char, Alloc>
const& s, c4::csubstr ss) {
return ss <
to_csubstr(s); }
49 template<
class Alloc> C4_ALWAYS_INLINE
bool operator<= (std::vector<char, Alloc>
const& s, c4::csubstr ss) {
return ss >=
to_csubstr(s); }
50 template<
class Alloc> C4_ALWAYS_INLINE
bool operator< (std::vector<char, Alloc>
const& s, c4::csubstr ss) {
return ss >
to_csubstr(s); }
56 inline size_t to_chars(c4::substr buf, std::vector<char, Alloc>
const& s)
59 size_t len = buf.len < s.size() ? buf.len : s.size();
65 memcpy(buf.str, s.data(), len);
72 inline bool from_chars(c4::csubstr buf, std::vector<char, Alloc> * s)
81 memcpy(&(*s)[0], buf.str, buf.len);
bool from_chars(csubstr buf, uint8_t *v) noexcept
csubstr to_csubstr(substr s) noexcept
neutral version for use in generic code
substr to_substr(substr s) noexcept
neutral version for use in generic code
bool operator!=(const char(&s)[N], basic_substring< C > const that) noexcept
bool operator>(const char(&s)[N], basic_substring< C > const that) noexcept
bool operator>=(const char(&s)[N], basic_substring< C > const that) noexcept
bool operator<=(const char(&s)[N], basic_substring< C > const that) noexcept
bool operator==(const char(&s)[N], basic_substring< C > const that) noexcept
bool operator<(const char(&s)[N], basic_substring< C > const that) noexcept
size_t to_chars(substr buf, uint8_t v) noexcept