24 #include <initializer_list> 28 #include <type_traits> 41 template <
class Char, std::
size_t N>
44 template <std::
size_t N>
48 namespace fixedstring {
52 template <
class =
void>
54 static constexpr std::size_t
npos =
static_cast<std::size_t
>(-1);
67 assert(!
"Array index out of bounds in BasicFixedString");
68 throw_exception<std::out_of_range>(
69 "Array index out of bounds in BasicFixedString");
84 assert(!
"Non-null terminated string used to initialize a BasicFixedString");
91 template <
class Char, std::
size_t N>
94 return a[N - 1u] ==
Char(0)
105 #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5 106 #pragma GCC diagnostic push 107 #pragma GCC diagnostic ignored "-Warray-bounds" 110 template <
class Left,
class Right>
113 std::size_t left_pos,
114 std::size_t left_size,
116 std::size_t right_pos,
118 return left_pos == left_size
121 : (left[left_pos] < right[right_pos]
123 : (left[left_pos] > right[right_pos]
134 template <
class Left,
class Right>
137 std::size_t left_size,
140 return left_size == right_size &&
144 template <
class Char,
class Left,
class Right>
147 std::size_t left_count,
149 std::size_t right_count,
151 return i < left_count
153 :
i < (left_count + right_count) ? right[
i - left_count] :
Char(0);
156 template <
class Char,
class Left,
class Right>
159 std::size_t left_size,
160 std::size_t left_pos,
161 std::size_t left_count,
163 std::size_t right_pos,
164 std::size_t right_count,
168 : (
i < right_count + left_pos ? right[
i - left_pos + right_pos]
169 : (
i < left_size - left_count + right_count
170 ? left[
i - right_count + left_count]
174 template <
class Left,
class Right>
180 return 0u ==
count ||
181 (left[pos +
count - 1u] == right[
count - 1u] &&
185 template <
class Char,
class Right>
192 template <
class Left,
class Right>
195 std::size_t left_size,
200 : left_size <= pos +
count 202 :
find_(left, left_size, right, pos + 1u,
count);
205 template <
class Left,
class Right>
217 template <
class Left,
class Right>
220 std::size_t left_size,
225 : left_size <= pos + 1u
230 template <
class Left,
class Right>
233 std::size_t left_size,
238 : left_size <= pos + 1u
243 template <
class Left,
class Right>
255 template <
class Left,
class Right>
268 template <
class Char,
class Left,
class Right, std::size_t... Is>
271 std::size_t left_count,
273 std::size_t right_count,
275 return {left, left_count, right, right_count, is};
278 template <
class Char,
class Left,
class Right, std::size_t... Is>
281 std::size_t left_size,
282 std::size_t left_pos,
283 std::size_t left_count,
285 std::size_t right_pos,
286 std::size_t right_count,
298 template <
class Char, std::
size_t N>
299 static constexpr
const Char (
305 #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 4 306 #pragma GCC diagnostic pop 325 using other =
typename std::conditional<
512 template <
class Char, std::
size_t N>
515 template <
class, std::
size_t>
533 template <
class That, std::size_t... Is>
540 : data_{(Is < (size - pos) && Is <
count ? that[Is + pos] :
Char(0))...,
544 template <std::size_t... Is>
552 template <
class Left,
class Right, std::size_t... Is>
555 std::size_t left_size,
557 std::size_t right_size,
559 : data_{detail::fixedstring::char_at_<Char>(
566 size_{left_size + right_size} {}
569 template <
class Left,
class Right, std::size_t... Is>
572 std::size_t left_size,
573 std::size_t left_pos,
574 std::size_t left_count,
576 std::size_t right_pos,
577 std::size_t right_count,
579 : data_{detail::fixedstring::char_at_<Char>(
589 size_{left_size - left_count + right_count} {}
633 template <std::
size_t M>
640 template <std::
size_t M>
643 std::size_t pos)
noexcept(
false) =
delete;
659 template <std::
size_t M>
684 template <std::size_t
M,
class =
typename std::enable_if<(M - 1
u <= N)>::type>
747 template <std::
size_t M>
752 data_[size_] =
Char(0);
766 template <std::size_t
M,
class =
typename std::enable_if<(M - 1
u <= N)>::type>
768 const Char (&that)[M]) noexcept {
782 std::initializer_list<Char> il)
noexcept(
false) {
784 for (std::size_t
i = 0u;
i < il.size(); ++
i) {
785 data_[
i] = il.begin()[
i];
788 data_[size_] =
Char(0);
811 operator std::basic_string<Char>()
const noexcept(
false) {
812 return std::basic_string<Char>{
begin(),
end()};
816 return std::basic_string<Char>{
begin(),
end()};
848 for (std::size_t
i = 0u;
i <
count; ++
i) {
852 data_[size_] =
Char(0);
860 template <std::
size_t M>
870 template <std::
size_t M>
873 std::size_t pos)
noexcept(
false) =
delete;
892 template <std::
size_t M>
909 template <std::size_t
M,
class =
typename std::enable_if<(M - 1
u <= N)>::type>
911 const Char (&that)[M]) noexcept {
931 for (std::size_t
i = 0u;
i <
count; ++
i) {
935 data_[size_] =
Char(0);
998 return data_ + size_;
1005 return data_ + size_;
1106 return i <= size_ ? data_[
i]
1107 : (throw_exception<std::out_of_range>(
1108 "Out of range in BasicFixedString::at"),
1116 return i <= size_ ? data_[
i]
1117 : (throw_exception<std::out_of_range>(
1118 "Out of range in BasicFixedString::at"),
1166 return data_[size_ - 1u];
1177 return data_[size_ - 1u];
1189 data_[0u] =
Char(0);
1199 data_[++size_] =
Char(0);
1220 data_[size_] =
Char(0);
1244 for (std::size_t
i = 0u;
i <
count; ++
i) {
1245 data_[size_ +
i] =
ch;
1248 data_[size_] =
Char(0);
1255 template <std::
size_t M>
1264 template <std::
size_t M>
1267 std::size_t pos)
noexcept(
false) =
delete;
1285 template <std::
size_t M>
1293 for (std::size_t
i = 0u;
i <
count; ++
i) {
1294 data_[size_ +
i] = that.
data_[pos +
i];
1297 data_[size_] =
Char(0);
1322 for (std::size_t
i = 0u;
i <
count; ++
i) {
1323 data_[size_ +
i] = that[
i];
1326 data_[size_] =
Char(0);
1344 template <std::
size_t M>
1347 return *
this + that;
1352 template <std::
size_t M>
1355 std::size_t pos)
const noexcept(
false) =
delete;
1362 template <std::
size_t M>
1367 return creplace(size_, 0u, that, pos,
count);
1375 template <std::
size_t M>
1377 const Char (&that)[M])
const noexcept {
1378 return creplace(size_, 0u, that);
1383 template <std::
size_t M>
1385 const Char (&that)[M],
1386 std::size_t pos)
const noexcept(
false) =
delete;
1393 template <std::
size_t M>
1397 return creplace(size_, 0u, that, pos,
count);
1413 template <std::
size_t M>
1433 std::initializer_list<Char> il)
noexcept(
false) {
1434 return append(il.begin(), il.size());
1459 std::size_t
count =
npos) noexcept(false) {
1460 using A =
const Char[1];
1474 erase(
first - data_, 1u);
1484 const Char* last)
noexcept(
false) {
1503 const noexcept(false) {
1504 using A =
const Char[1];
1517 template <std::
size_t M>
1519 return compare(0u, size_, that, 0u, that.
size_);
1527 template <std::
size_t M>
1529 std::size_t this_pos,
1530 std::size_t this_count,
1532 return compare(this_pos, this_count, that, 0u, that.
size_);
1540 template <std::
size_t M>
1542 std::size_t this_pos,
1543 std::size_t this_count,
1545 std::size_t that_pos,
1546 std::size_t that_count)
const noexcept(
false) {
1562 constexpr
int compare(
const Char* that)
const noexcept {
1570 return compare(0u, size_, that.
begin(), that.
size());
1579 std::size_t this_pos,
1580 std::size_t this_count,
1581 const Char* that)
const noexcept(
false) {
1589 std::size_t this_pos,
1590 std::size_t this_count,
1592 return compare(this_pos, this_count, that.
begin(), that.
size());
1611 std::size_t this_pos,
1612 std::size_t this_count,
1614 std::size_t that_count)
const noexcept(
false) {
1626 std::size_t this_pos,
1627 std::size_t this_count,
1629 std::size_t that_count)
const noexcept(
false) {
1642 return {*
this, pos};
1651 return {*
this, pos,
count};
1662 template <std::
size_t M>
1678 template <std::
size_t M>
1680 std::size_t this_pos,
1681 std::size_t this_count,
1683 std::size_t that_pos = 0u) noexcept(false) {
1684 return replace(this_pos, this_count, that, that_pos, that.
size_ - that_pos);
1695 template <std::
size_t M>
1697 std::size_t this_pos,
1698 std::size_t this_count,
1700 std::size_t that_pos,
1701 std::size_t that_count)
noexcept(
false) {
1702 return *
this = creplace(this_pos, this_count, that, that_pos, that_count);
1712 std::size_t this_pos,
1713 std::size_t this_count,
1714 const Char* that)
noexcept(
false) {
1729 const Char* that)
noexcept(
false) {
1752 std::size_t this_pos,
1753 std::size_t this_count,
1755 std::size_t that_count)
noexcept(
false) {
1756 return *
this = detail::fixedstring::Helper::replace_<Char>(
1761 this_count, size_ - this_pos),
1775 std::size_t this_pos,
1776 std::size_t this_count,
1777 std::size_t that_count,
1791 std::size_t that_count,
1808 std::initializer_list<Char> il)
noexcept(
false) {
1821 template <std::
size_t M>
1823 std::size_t this_pos,
1824 std::size_t this_count,
1826 std::size_t that_pos = 0u)
const noexcept(false) {
1858 template <std::
size_t M>
1860 std::size_t this_pos,
1861 std::size_t this_count,
1863 std::size_t that_pos,
1864 std::size_t that_count)
const noexcept(
false) {
1865 return detail::fixedstring::Helper::replace_<Char>(
1873 that_count, that.
size_ - that_pos),
1886 template <std::
size_t M>
1891 std::size_t that_pos = 0u)
const noexcept(false) {
1908 template <std::
size_t M>
1913 std::size_t that_pos,
1914 std::size_t that_count)
const noexcept(
false) {
1915 return creplace(
first - data_, last -
first, that, that_pos, that_count);
1926 template <std::
size_t M>
1928 std::size_t this_pos,
1929 std::size_t this_count,
1930 const Char (&that)[M])
const noexcept(
false) {
1931 return creplace(this_pos, this_count, that, 0u, M - 1u);
1959 template <std::
size_t M>
1961 std::size_t this_pos,
1962 std::size_t this_count,
1963 const Char (&that)[M],
1964 std::size_t that_pos,
1965 std::size_t that_count)
const noexcept(
false) {
1966 return detail::fixedstring::Helper::replace_<Char>(
1985 template <std::
size_t M>
1989 return creplace(first - data_, last - first, that, 0u, M - 1u);
2001 template <std::
size_t M>
2005 const Char (&that)[M],
2006 std::size_t that_pos,
2007 std::size_t that_count)
const noexcept(
false) {
2008 return creplace(first - data_, last - first, that, that_pos, that_count);
2031 for (std::size_t
i = 0u;
i <
count; ++
i) {
2032 if (
i + pos == size_) {
2035 dest[
i] = data_[
i + pos];
2056 if (
count == size_) {
2057 }
else if (
count < size_) {
2059 data_[size_] =
Char(0);
2061 for (; size_ <
count; ++size_) {
2064 data_[size_] =
Char(0);
2072 template <std::
size_t M>
2075 return find(that, 0u);
2084 template <std::
size_t M>
2087 std::size_t pos)
const noexcept(
false) {
2097 constexpr std::size_t
find(
const Char* that)
const noexcept {
2107 constexpr std::size_t
find(
const Char* that, std::size_t pos)
const 2136 constexpr std::size_t
find(Char
ch)
const noexcept {
2137 return find(
ch, 0u);
2147 using A =
const Char[1u];
2158 template <std::
size_t M>
2161 return rfind(that, size_);
2169 template <std::
size_t M>
2172 std::size_t pos)
const noexcept(
false) {
2173 return that.
size_ <= size_
2179 size_ - that.
size_),
2189 constexpr std::size_t
rfind(
const Char* that)
const noexcept {
2198 constexpr std::size_t
rfind(
const Char* that, std::size_t pos)
const 2218 return count <= size_
2233 constexpr std::size_t
rfind(Char
ch)
const noexcept {
2244 using A =
const Char[1u];
2259 template <std::
size_t M>
2262 return find_first_of(that, 0u);
2270 template <std::
size_t M>
2273 std::size_t pos)
const noexcept(
false) {
2326 return find_first_of(
ch, 0u);
2336 using A =
const Char[1u];
2346 template <std::
size_t M>
2349 return find_first_not_of(that, 0u);
2356 template <std::
size_t M>
2359 std::size_t pos)
const noexcept(
false) {
2405 data_, size_, that, pos,
count);
2413 return find_first_not_of(
ch, 0u);
2423 using A =
const Char[1u];
2433 template <std::
size_t M>
2436 return find_last_of(that, size_);
2444 template <std::
size_t M>
2447 std::size_t pos)
const noexcept(
false) {
2473 constexpr std::size_t
find_last_of(
const Char* that, std::size_t pos)
const 2509 return find_last_of(
ch, size_);
2519 using A =
const Char[1u];
2534 template <std::
size_t M>
2537 return find_last_not_of(that, size_);
2545 template <std::
size_t M>
2548 std::size_t pos)
const noexcept(
false) {
2610 return find_last_not_of(
ch, size_);
2620 using A =
const Char[1u];
2646 const Char*
b) noexcept {
2679 const Char*
b) noexcept {
2714 const Char*
b) noexcept {
2728 a.begin(), 0u,
a.size(),
b.data_, 0u,
b.size_);
2739 a.data_, 0u,
a.size_,
b.begin(), 0u,
b.size());
2753 const Char*
b) noexcept {
2786 const Char*
b) noexcept {
2819 const Char*
b) noexcept {
2844 template <std::
size_t M>
2848 return detail::fixedstring::Helper::concat_<Char>(
2859 template <std::
size_t M>
2862 const Char (&
b)[M]) noexcept {
2863 return detail::fixedstring::Helper::concat_<Char>(
2877 using A =
const Char[2u];
2878 return detail::fixedstring::Helper::concat_<Char>(
2892 using A =
const Char[2u];
2893 return detail::fixedstring::Helper::concat_<Char>(
2902 template <
class C, std::
size_t N>
2904 std::basic_ostream<C>& os,
2906 using StreamSize = decltype(os.width());
2907 os.write(
string.
begin(), static_cast<StreamSize>(
string.
size()));
2914 template <
class Char, std::
size_t A, std::
size_t B>
2925 template <
class Char, std::
size_t A, std::
size_t B>
2932 template <
class Char, std::
size_t A, std::
size_t B>
2946 template <
class Char, std::
size_t A, std::
size_t B>
2953 template <
class Char, std::
size_t A, std::
size_t B>
2960 template <
class Char, std::
size_t A, std::
size_t B>
2970 template <
class Char, std::
size_t N, std::
size_t M>
2974 return detail::fixedstring::Helper::concat_<Char>(
2990 template <
class Char, std::
size_t N>
2992 const Char (&
a)[N]) noexcept {
2999 template <
class Char, std::
size_t N>
3006 inline namespace literals {
3007 inline namespace string_literals {
3014 #if defined(__GNUC__) && !defined(__ICC) 3015 #pragma GCC diagnostic push 3016 #pragma GCC diagnostic ignored "-Wpragmas" 3017 #pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template" 3039 template <
class Char, Char... Cs>
3041 #if __cplusplus >= 201402L 3042 const Char
a[] = {Cs...,
Char(0)};
3043 return {+
a,
sizeof...(Cs)};
3045 using A =
const Char[
sizeof...(Cs) + 1u];
3047 return {+
A{Cs...,
Char(0)},
sizeof...(Cs)};
3051 #pragma GCC diagnostic pop 3054 #define FOLLY_DEFINE_FIXED_STRING_UDL(N) \ 3055 constexpr FixedString<N> operator"" _fs##N( \ 3056 const char* that, std::size_t count) noexcept(false) { \ 3057 return {that, count}; \ 3069 #undef FOLLY_DEFINE_FIXED_STRING_UDL constexpr BasicFixedString cerase(std::size_t pos, std::size_t count=npos) const noexcept(false)
constexpr BasicFixedString< Char, N+M-1u > cappend(const Char(&that)[M]) const noexcept
friend constexpr ReverseIterator operator+(ReverseIterator that, std::ptrdiff_t i) noexcept
friend constexpr bool operator>=(const BasicFixedString &a, Range< const Char * > const &b) noexcept
bool operator>(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator+=(Char ch) noexcept(false)
constexpr std::size_t find_first_of(const BasicFixedString< Char, M > &that) const noexcept
static constexpr std::size_t capacity() noexcept
void BENCHFUN() resize(size_t iters, size_t arg)
friend constexpr std::ptrdiff_t operator-(ReverseIterator a, ReverseIterator b) noexcept
friend constexpr bool operator>(const BasicFixedString &a, Range< const Char * > b) noexcept
constexpr const_reverse_iterator crend() const noexcept
constexpr int compare(std::size_t this_pos, std::size_t this_count, const BasicFixedString< Char, M > &that) const noexcept(false)
constexpr std::size_t find_first_of(const Char *that) const noexcept
constexpr BasicFixedString substr(std::size_t pos) const noexcept(false)
friend constexpr ReverseIterator operator-(ReverseIterator that, std::ptrdiff_t i) noexcept
constexpr std::size_t find_last_of(const BasicFixedString< Char, M > &that) const noexcept
constexpr const_reverse_iterator rbegin() const noexcept
FOLLY_CPP14_CONSTEXPR Range< Char * > toRange() noexcept
constexpr BasicFixedString(const BasicFixedString< Char, M > &that) noexcept(M<=N)
constexpr BasicFixedString< Char, N+M-1u > creplace(const Char *first, const Char *last, const Char(&that)[M]) const noexcept(false)
constexpr std::size_t find_first_not_of(const Char *that, std::size_t pos) const noexcept(false)
FOLLY_CPP14_CONSTEXPR Char & at(std::size_t i) noexcept(false)
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(std::size_t this_pos, std::size_t this_count, const Char *that) noexcept(false)
constexpr BasicFixedString< Char, N+1u > cpush_back(Char ch) const noexcept
constexpr Range< const Char * > toRange() const noexcept
FOLLY_CPP14_CONSTEXPR std::size_t copy(Char *dest, std::size_t count) const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator+=(std::initializer_list< Char > il) noexcept(false)
constexpr const Char(& checkNullTerminated(const Char(&a)[N]) noexcept)[N]
FOLLY_CPP14_CONSTEXPR Char * erase(const Char *first, const Char *last) noexcept(false)
std::uint32_t hash() const noexcept
constexpr BasicFixedString(const Left &left, std::size_t left_size, const Right &right, std::size_t right_size, folly::index_sequence< Is... >) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator=(const BasicFixedString< Char, M > &that) noexcept(M<=N)
constexpr BasicFixedString< Char, N-1u > cpop_back() const noexcept(false)
constexpr std::size_t rfind(Char ch, std::size_t pos) const noexcept(false)
constexpr BasicFixedString< Char, 0u > cerase() const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator+=(const Char *that) noexcept(false)
FOLLY_CPP14_CONSTEXPR Char & operator[](std::size_t i) noexcept
constexpr int compare(std::size_t this_pos, std::size_t this_count, Range< const Char * > that, std::size_t that_count) const noexcept(false)
friend constexpr BasicFixedString< Char, N+1u > operator+(Char a, const BasicFixedString &b) noexcept
FOLLY_CPP14_CONSTEXPR Char * end() noexcept
constexpr BasicFixedString< Char, N+M > cappend(const BasicFixedString< Char, M > &that, std::size_t pos, std::size_t count) const noexcept(false)
friend constexpr bool operator==(const BasicFixedString &a, const Char *b) noexcept
constexpr BasicFixedString< Char, N+M-1u > creplace(std::size_t this_pos, std::size_t this_count, const Char(&that)[M]) const noexcept(false)
constexpr std::size_t checkOverflow(std::size_t i, std::size_t max)
#define FOLLY_CPP14_CONSTEXPR
constexpr std::size_t find(const Char *that) const noexcept
constexpr T constexpr_min(T a)
constexpr detail::Map< Move > move
FOLLY_CPP14_CONSTEXPR void clear() noexcept
friend constexpr bool operator<=(const BasicFixedString &a, const Char *b) noexcept
friend constexpr bool operator<(const BasicFixedString &a, const Char *b) noexcept
constexpr const Char & front() const noexcept
folly::make_index_sequence< N > Indices
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator=(std::initializer_list< Char > il) noexcept(false)
constexpr std::size_t rfind(Char ch) const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(std::size_t this_pos, std::size_t this_count, const BasicFixedString< Char, M > &that, std::size_t that_pos, std::size_t that_count) noexcept(false)
constexpr const Char & operator[](std::size_t i) const noexcept
void append(std::unique_ptr< IOBuf > &buf, StringPiece str)
auto begin(TestAdlIterable &instance)
FOLLY_CPP14_CONSTEXPR BasicFixedString & erase() noexcept
constexpr BasicFixedString< Char, N+M > cappend(const BasicFixedString< Char, M > &that) const noexcept
constexpr std::size_t find_first_not_of(const Char *that, std::size_t pos, std::size_t count) const noexcept(false)
constexpr std::size_t find_last_of(const Char *that) const noexcept
constexpr bool find_at_(const Left &left, const Right &right, std::size_t pos, std::size_t count) noexcept
friend constexpr bool operator!=(Range< const Char * > a, const BasicFixedString &b) noexcept
const Char * const_iterator
constexpr BasicFixedString< Char, N+M > creplace(std::size_t this_pos, std::size_t this_count, const BasicFixedString< Char, M > &that, std::size_t that_pos=0u) const noexcept(false)
constexpr BasicFixedString(const Char *that, std::size_t count) noexcept(false)
constexpr std::size_t find_first_of(Char ch) const noexcept
FOLLY_CPP14_CONSTEXPR void resize(std::size_t count) noexcept(false)
FOLLY_CPP14_CONSTEXPR ReverseIterator operator--(int) noexcept
static constexpr BasicFixedString< Char, sizeof...(Is)> replace_(const Left &left, std::size_t left_size, std::size_t left_pos, std::size_t left_count, const Right &right, std::size_t right_pos, std::size_t right_count, folly::index_sequence< Is... > is) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & assign(const BasicFixedString< Char, M > &that, std::size_t pos, std::size_t count) noexcept(false)
constexpr BasicFixedString substr(std::size_t pos, std::size_t count) const noexcept(false)
constexpr bool equal_(const Left &left, std::size_t left_size, const Right &right, std::size_t right_size) noexcept
—— Concurrent Priority Queue Implementation ——
friend constexpr bool operator>=(const BasicFixedString &a, const Char *b) noexcept
constexpr BasicFixedString< Char, N+M > creplace(const Char *first, const Char *last, const BasicFixedString< Char, M > &that, std::size_t that_pos=0u) const noexcept(false)
constexpr size_t constexpr_strlen_internal(const Char *s, size_t len)
FOLLY_CPP14_CONSTEXPR BasicFixedString & assign(const Char(&that)[M]) noexcept
constexpr std::size_t checkOverflowOrNpos(std::size_t i, std::size_t max)
requires E e noexcept(noexcept(s.error(std::move(e))))
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(std::size_t this_pos, std::size_t this_count, std::size_t that_count, Char ch) noexcept(false)
constexpr std::size_t find_last_of(const Char *that, std::size_t pos, std::size_t count) const noexcept(false)
constexpr std::size_t rfind(const Char *that) const noexcept
constexpr std::size_t find_first_not_of(Char ch, std::size_t pos) const noexcept(false)
constexpr Char char_at_(const Left &left, std::size_t left_count, const Right &right, std::size_t right_count, std::size_t i) noexcept
constexpr std::size_t find(const Char *that, std::size_t pos, std::size_t count) const noexcept(false)
FOLLY_CPP14_CONSTEXPR Char * erase(const Char *first) noexcept(false)
constexpr std::size_t find_first_of(const BasicFixedString< Char, M > &that, std::size_t pos) const noexcept(false)
FOLLY_CPP14_CONSTEXPR BasicFixedString & assign(std::size_t count, Char ch) noexcept(false)
constexpr int compare(std::size_t this_pos, std::size_t this_count, const Char *that, std::size_t that_count) const noexcept(false)
FOLLY_CPP14_CONSTEXPR void pop_back() noexcept(false)
FOLLY_CPP14_CONSTEXPR void swap(BasicFixedString &that) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & append(const Char *that, std::size_t count) noexcept(false)
constexpr std::size_t find(const Char *that, std::size_t pos) const noexcept(false)
ScopeGuardImpl< typename std::decay< FunctionType >::type, true > operator+(detail::ScopeGuardOnExit, FunctionType &&fn)
constexpr T constexpr_max(T a)
std::ptrdiff_t difference_type
constexpr std::size_t find_first_of(const Char *that, std::size_t pos, std::size_t count) const noexcept(false)
void BENCHFUN() replace(size_t iters, size_t arg)
constexpr ReverseIterator(T *p) noexcept
void BENCHFUN() push_back(size_t iters, size_t arg)
constexpr std::size_t find(Char ch, std::size_t pos) const noexcept(false)
constexpr reference operator*() const
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(const Char *first, const Char *last, const Char *that) noexcept(false)
friend constexpr bool operator>=(Range< const Char * > a, const BasicFixedString &b) noexcept
constexpr BasicFixedString< Char, N+M > creplace(const Char *first, const Char *last, const BasicFixedString< Char, M > &that, std::size_t that_pos, std::size_t that_count) const noexcept(false)
typename std::remove_const< T >::type value_type
static constexpr const Char(& data_(const BasicFixedString< Char, N > &that) noexcept)[N+1u]
friend constexpr bool operator!=(const BasicFixedString &a, const Char *b) noexcept
bool operator!=(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
typename std::conditional< std::is_const< T >::value, ReverseIterator< typename std::remove_const< T >::type >, dummy_ >::type other
static constexpr BasicFixedString< Char, sizeof...(Is)> concat_(const Left &left, std::size_t left_count, const Right &right, std::size_t right_count, folly::index_sequence< Is... > is) noexcept
constexpr bool find_one_of_at_(Char ch, const Right &right, std::size_t pos) noexcept
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
FOLLY_CPP14_CONSTEXPR Char * data() noexcept
constexpr auto size(C const &c) -> decltype(c.size())
friend constexpr BasicFixedString< Char, N+1u > operator+(const BasicFixedString &a, Char b) noexcept
constexpr std::size_t find_last_not_of(const Char *that, std::size_t pos, std::size_t count) const noexcept(false)
constexpr int compare(std::size_t this_pos, std::size_t this_count, const Char *that) const noexcept(false)
constexpr BasicFixedString(const Left &left, std::size_t left_size, std::size_t left_pos, std::size_t left_count, const Right &right, std::size_t right_pos, std::size_t right_count, folly::index_sequence< Is... >) noexcept
#define FOLLY_DEFINE_FIXED_STRING_UDL(N)
friend constexpr bool operator<(const Char *a, const BasicFixedString &b) noexcept
constexpr const Char & at(std::size_t i) const noexcept(false)
constexpr const Char * cbegin() const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & append(const BasicFixedString< Char, M > &that, std::size_t pos, std::size_t count) noexcept(false)
constexpr BasicFixedString(std::size_t count, Char ch, folly::index_sequence< Is... >) noexcept
constexpr std::size_t find_(const Left &left, std::size_t left_size, const Right &right, std::size_t pos, std::size_t count) noexcept
auto end(TestAdlIterable &instance)
FOLLY_CPP14_CONSTEXPR void push_back(Char ch) noexcept(false)
constexpr std::size_t find(const BasicFixedString< Char, M > &that) const noexcept
constexpr const Char * c_str() const noexcept
FOLLY_CPP14_CONSTEXPR std::size_t copy(Char *dest, std::size_t count, std::size_t pos) const noexcept(false)
FOLLY_CPP14_CONSTEXPR ReverseIterator & operator--() noexcept
size_t rfind(const Range< Iter > &haystack, const typename Range< Iter >::value_type &needle)
constexpr std::size_t find_last_not_of(const BasicFixedString< Char, M > &that, std::size_t pos) const noexcept(false)
constexpr std::size_t find_last_not_of(const Char *that) const noexcept
make_integer_sequence< std::size_t, Size > make_index_sequence
A class for holding up to N characters of type Char that is amenable to constexpr string manipulation...
FOLLY_CPP14_CONSTEXPR Char & back() noexcept
constexpr std::size_t rfind(const BasicFixedString< Char, M > &that, std::size_t pos) const noexcept(false)
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(const Char *first, const Char *last, std::initializer_list< Char > il) noexcept(false)
friend constexpr bool operator>(Range< const Char * > a, const BasicFixedString &b) noexcept
constexpr BasicFixedString()
constexpr std::size_t find_first_of(const Char *that, std::size_t pos) const noexcept(false)
friend constexpr bool operator!=(const Char *a, const BasicFixedString &b) noexcept
std::random_access_iterator_tag iterator_category
FOLLY_CPP14_CONSTEXPR Char & front() noexcept
friend constexpr bool operator==(const Char *a, const BasicFixedString &b) noexcept
constexpr BasicFixedString< Char, N+M-1u > cappend(const Char(&that)[M], std::size_t pos, std::size_t count) const noexcept(false)
constexpr std::size_t find_first_not_of(Char ch) const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator+=(const BasicFixedString< Char, M > &that) noexcept(false)
constexpr std::size_t find_first_of_(const Left &left, std::size_t left_size, const Right &right, std::size_t pos, std::size_t count) noexcept
constexpr std::size_t find_last_of(Char ch, std::size_t pos) const noexcept(false)
constexpr int compare(const Char *that) const noexcept
constexpr std::size_t rfind_(const Left &left, const Right &right, std::size_t pos, std::size_t count) noexcept
static const char *const value
constexpr std::size_t find_last_not_of_(const Left &left, const Right &right, std::size_t pos, std::size_t count) noexcept
constexpr std::size_t find_last_of_(const Left &left, const Right &right, std::size_t pos, std::size_t count) noexcept
constexpr int compare(const BasicFixedString< Char, M > &that) const noexcept
constexpr BasicFixedString(std::initializer_list< Char > il) noexcept(false)
FOLLY_CPP14_CONSTEXPR ReverseIterator operator++(int) noexcept
constexpr std::size_t find_last_not_of(const Char *that, std::size_t pos) const noexcept(false)
**Optimized Holders **The template hazptr_array< M > provides most of the functionality *of M hazptr_holder s but with faster construction destruction *for M
constexpr int compare(Range< const Char * > that) const noexcept
friend constexpr bool operator<=(const BasicFixedString &a, Range< const Char * > b) noexcept
friend constexpr bool operator!=(ReverseIterator a, ReverseIterator b) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(std::size_t this_pos, std::size_t this_count, const Char *that, std::size_t that_count) noexcept(false)
constexpr std::size_t find_first_not_of(const BasicFixedString< Char, M > &that) const noexcept
bool operator>=(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
constexpr const_reverse_iterator rend() const noexcept
const Char * const_pointer
FOLLY_CPP14_CONSTEXPR void constexpr_swap(T &a, T &b) noexcept(noexcept(a=T(std::move(a))))
friend constexpr bool operator>=(const Char *a, const BasicFixedString &b) noexcept
void swap(exception_wrapper &a, exception_wrapper &b) noexcept
constexpr std::size_t find(Char ch) const noexcept
FOLLY_CPP14_CONSTEXPR ReverseIterator & operator++() noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & operator=(const Char(&that)[M]) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & append(const Char *that) noexcept(false)
constexpr std::size_t find_last_not_of(Char ch) const noexcept
FOLLY_CPP14_CONSTEXPR reverse_iterator rend() noexcept
constexpr std::size_t find_last_not_of(const BasicFixedString< Char, M > &that) const noexcept
constexpr size_t constexpr_strlen(const Char *s)
bool operator==(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
constexpr const Char & back() const noexcept
FOLLY_CPP14_CONSTEXPR void resize(std::size_t count, Char ch) noexcept(false)
std::ptrdiff_t difference_type
constexpr std::size_t rfind(const BasicFixedString< Char, M > &that) const noexcept
FOLLY_CPP14_CONSTEXPR Char * begin() noexcept
friend constexpr bool operator<=(Range< const Char * > const &a, const BasicFixedString &b) noexcept
constexpr int compare(std::size_t this_pos, std::size_t this_count, Range< const Char * > that) const noexcept(false)
FOLLY_CPP14_CONSTEXPR BasicFixedString & assign(const Char *that, std::size_t count) noexcept(false)
constexpr std::size_t size() const noexcept
bool operator<=(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
constexpr std::size_t find_last_not_of(Char ch, std::size_t pos) const noexcept(false)
constexpr int compare(std::size_t this_pos, std::size_t this_count, const BasicFixedString< Char, M > &that, std::size_t that_pos, std::size_t that_count) const noexcept(false)
constexpr std::size_t rfind(const Char *that, std::size_t pos, std::size_t count) const noexcept(false)
FOLLY_CPP14_CONSTEXPR BasicFixedString & append(std::size_t count, Char ch) noexcept(false)
constexpr const Char * begin() const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & append(const BasicFixedString< Char, M > &that) noexcept(false)
constexpr std::size_t find_first_not_of(const BasicFixedString< Char, M > &that, std::size_t pos) const noexcept(false)
friend constexpr bool operator<(const BasicFixedString &a, Range< const Char * > b) noexcept
friend constexpr bool operator<(Range< const Char * > a, const BasicFixedString &b) noexcept
constexpr ReverseIterator(const other &that) noexcept
FOLLY_CPP14_CONSTEXPR ReverseIterator & operator-=(std::ptrdiff_t i) noexcept
friend constexpr BasicFixedString< Char, N+M-1u > operator+(const Char(&a)[M], const BasicFixedString &b) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & assign(const BasicFixedString< Char, M > &that) noexcept(M<=N)
constexpr std::size_t find(const BasicFixedString< Char, M > &that, std::size_t pos) const noexcept(false)
constexpr std::size_t find_last_of(const BasicFixedString< Char, M > &that, std::size_t pos) const noexcept(false)
constexpr const Char * data() const noexcept
static constexpr std::size_t npos
friend constexpr bool operator==(const BasicFixedString &a, Range< const Char * > b) noexcept
constexpr const Char * cend() const noexcept
friend constexpr BasicFixedString< Char, N+M-1u > operator+(const BasicFixedString &a, const Char(&b)[M]) noexcept
constexpr BasicFixedString< Char, N+M > creplace(std::size_t this_pos, std::size_t this_count, const BasicFixedString< Char, M > &that, std::size_t that_pos, std::size_t that_count) const noexcept(false)
std::basic_string< Char > toStdString() const noexcept(false)
constexpr std::size_t find_last_of(Char ch) const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(const Char *first, const Char *last, std::size_t that_count, Char ch) noexcept(false)
void assertNotNullTerminated() noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(const Char *first, const Char *last, const BasicFixedString< Char, M > &that) noexcept(false)
constexpr BasicFixedString< Char, N+M-1u > creplace(std::size_t this_pos, std::size_t this_count, const Char(&that)[M], std::size_t that_pos, std::size_t that_count) const noexcept(false)
constexpr std::size_t rfind(const Char *that, std::size_t pos) const noexcept(false)
constexpr BasicFixedString(const Char(&that)[M]) noexcept
friend constexpr ReverseIterator operator+(std::ptrdiff_t i, ReverseIterator that) noexcept
constexpr bool empty() const noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & erase(std::size_t pos, std::size_t count=npos) noexcept(false)
std::uint32_t hsieh_hash32_buf(const void *buf, std::size_t len)
constexpr ordering compare_(const Left &left, std::size_t left_pos, std::size_t left_size, const Right &right, std::size_t right_pos, std::size_t right_size) noexcept
friend constexpr bool operator!=(const BasicFixedString &a, Range< const Char * > b) noexcept
friend constexpr bool operator==(Range< const Char * > a, const BasicFixedString &b) noexcept
static constexpr std::size_t max_size() noexcept
constexpr const Char * end() const noexcept
friend constexpr bool operator<=(const Char *a, const BasicFixedString &b) noexcept
constexpr BasicFixedString(std::size_t count, Char ch) noexcept(false)
constexpr BasicFixedString(const That &that, std::size_t size, folly::index_sequence< Is... >, std::size_t pos=0, std::size_t count=npos) noexcept
constexpr reference operator[](std::ptrdiff_t i) const noexcept
constexpr BasicFixedString< Char, N+M-1u > creplace(const Char *first, const Char *last, const Char(&that)[M], std::size_t that_pos, std::size_t that_count) const noexcept(false)
friend constexpr bool operator>(const Char *a, const BasicFixedString &b) noexcept
FOLLY_CPP14_CONSTEXPR reverse_iterator rbegin() noexcept
friend constexpr bool operator==(ReverseIterator a, ReverseIterator b) noexcept
FOLLY_CPP14_CONSTEXPR BasicFixedString & replace(std::size_t this_pos, std::size_t this_count, const BasicFixedString< Char, M > &that, std::size_t that_pos=0u) noexcept(false)
constexpr std::size_t find_last_of(const Char *that, std::size_t pos) const noexcept(false)
const Char & const_reference
std::enable_if< IsLessThanComparable< Value >::value, bool >::type operator<(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
friend constexpr bool operator>(const BasicFixedString &a, const Char *b) noexcept
FOLLY_CPP14_CONSTEXPR ReverseIterator & operator+=(std::ptrdiff_t i) noexcept
constexpr std::size_t find_first_not_of_(const Left &left, std::size_t left_size, const Right &right, std::size_t pos, std::size_t count) noexcept
constexpr detail::First first
constexpr std::size_t length() const noexcept
constexpr BasicFixedString< Char, N+1u > cappend(Char ch) const noexcept
constexpr BasicFixedString< Char, N-1u > makeFixedString(const Char(&a)[N]) noexcept
constexpr const_reverse_iterator crbegin() const noexcept
constexpr std::size_t find_first_of(Char ch, std::size_t pos) const noexcept(false)
constexpr BasicFixedString(const BasicFixedString< Char, M > &that, std::size_t pos, std::size_t count) noexcept(false)
constexpr std::size_t find_first_not_of(const Char *that) const noexcept
std::ostream & operator<<(std::ostream &out, dynamic const &d)