31 using invalid_argument::invalid_argument;
45 align(
Align::DEFAULT),
48 thousandsSeparator(false),
52 precision(kDefaultPrecision),
53 presentation(kDefaultPresentation),
75 template <
typename...
Args>
78 error(std::forward<Args>(args)...);
82 template <
typename...
Args>
84 template <
typename...
Args>
85 [[noreturn]]
void error(
Args&&... args)
const;
95 static constexpr
char kDefaultFill =
'\0';
141 static constexpr
int kDefaultWidth = -1;
142 static constexpr
int kDynamicWidth = -2;
143 static constexpr
int kNoIndex = -1;
150 static constexpr
int kDefaultPrecision = -1;
156 static constexpr
char kDefaultPresentation =
'\0';
163 template <
bool emptyOk = false>
181 nextKeyMode_ = NextKeyMode::INT;
193 template <
bool emptyOk>
207 template <
typename...
Args>
209 return to<std::string>(
210 "invalid format argument {",
213 std::forward<Args>(args)...);
216 template <
typename...
Args>
218 throw_exception<BadFormatArg>(errorStr(std::forward<Args>(args)...));
221 template <
bool emptyOk>
223 enforce(nextKeyMode_ != NextKeyMode::INT,
"integer key expected");
224 return doSplitKey<emptyOk>();
227 template <
bool emptyOk>
232 enforce(!nextKey_.empty(),
"non-empty key required");
239 error(
"non-empty key required");
244 const char*
b = key_.begin();
245 const char* e = key_.end();
249 p =
static_cast<const char*
>(memchr(b,
'[',
size_t(e - b)));
250 enforce(p !=
nullptr,
"unmatched ']'");
252 p =
static_cast<const char*
>(memchr(b,
'.',
size_t(e - b)));
255 key_.assign(p + 1, e);
261 enforce(b != p,
"non-empty key required");
267 if (nextKeyMode_ == NextKeyMode::INT) {
272 return to<int>(doSplitKey<true>());
273 }
catch (
const std::out_of_range&) {
274 error(
"integer key required");
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
—— Concurrent Priority Queue Implementation ——
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
constexpr bool empty() const
Range< const char * > StringPiece