27 int index = m[1].str().empty() ? -1 : std::stoi(m[1].str());
28 std::string flag = m[2].str();
29 int width = m[3].str().empty() ? -1 : std::stoi(m[3].str());
30 int precision = m[4].str().empty() ? -1 : std::stoi(m[4].str());
32 std::string tT = m[5].str();
35 bool dt = !tT.empty();
40 m[6].str().length() == 1,
"format conversion should be one character");
41 char conversion = m[6].str()[0];
50 const std::string format_specifier =
51 "%(\\d+\\$)?([-#+ 0,(\\<]*)?(\\d+)?(\\.\\d+)?([tT])?([a-zA-Z%])";
52 std::regex regex(format_specifier);
53 std::vector<format_elementt> al;
56 while(std::regex_search(s, match, regex))
58 if(match.position() != 0)
60 std::string pre_match = s.substr(0, match.position());
61 al.emplace_back(pre_match);
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.