|
20 | 20 | #include <regex> |
21 | 21 | #include <iostream> |
22 | 22 | #include <cassert> |
| 23 | +#include <cstddef> |
23 | 24 |
|
24 | 25 | using namespace docopt; |
25 | 26 |
|
@@ -119,7 +120,7 @@ bool LeafPattern::match(PatternList& left, std::vector<std::shared_ptr<LeafPatte |
119 | 120 | return false; |
120 | 121 | } |
121 | 122 |
|
122 | | - left.erase(left.begin()+static_cast<ptrdiff_t>(match.first)); |
| 123 | + left.erase(left.begin()+static_cast<std::ptrdiff_t>(match.first)); |
123 | 124 |
|
124 | 125 | auto same_name = std::find_if(collected.begin(), collected.end(), [&](std::shared_ptr<LeafPattern> const& p) { |
125 | 126 | return p->name()==name(); |
@@ -170,7 +171,7 @@ Option Option::parse(std::string const& option_description) |
170 | 171 | auto double_space = option_description.find(" "); |
171 | 172 | auto options_end = option_description.end(); |
172 | 173 | if (double_space != std::string::npos) { |
173 | | - options_end = option_description.begin() + static_cast<ptrdiff_t>(double_space); |
| 174 | + options_end = option_description.begin() + static_cast<std::ptrdiff_t>(double_space); |
174 | 175 | } |
175 | 176 |
|
176 | 177 | static const std::regex pattern {"(-{1,2})?(.*?)([,= ]|$)"}; |
@@ -512,7 +513,7 @@ class Tokens { |
512 | 513 | std::string the_rest() const { |
513 | 514 | if (!*this) |
514 | 515 | return {}; |
515 | | - return join(fTokens.begin()+static_cast<ptrdiff_t>(fIndex), |
| 516 | + return join(fTokens.begin()+static_cast<std::ptrdiff_t>(fIndex), |
516 | 517 | fTokens.end(), |
517 | 518 | " "); |
518 | 519 | } |
@@ -920,7 +921,7 @@ static std::vector<Option> parse_defaults(std::string const& doc) { |
920 | 921 | std::vector<Option> defaults; |
921 | 922 |
|
922 | 923 | for(auto s : parse_section("options:", doc)) { |
923 | | - s.erase(s.begin(), s.begin()+static_cast<ptrdiff_t>(s.find(':'))+1); // get rid of "options:" |
| 924 | + s.erase(s.begin(), s.begin()+static_cast<std::ptrdiff_t>(s.find(':'))+1); // get rid of "options:" |
924 | 925 |
|
925 | 926 | std::for_each(std::sregex_iterator{ s.begin(), s.end(), pattern }, |
926 | 927 | std::sregex_iterator{}, |
|
0 commit comments