Commit da9210d41e170c243e438031783f6efc83caee33
1 parent
5e9f8225
fix multiple definitions
Fixes #61. Commit 5e9f8225982e9711b548c886fe6b477cdefd0fd4 introduced duplicate definitions across separate translation units.
Showing
1 changed file
with
13 additions
and
2 deletions
include/cxxopts.hpp
| ... | ... | @@ -412,8 +412,11 @@ namespace cxxopts |
| 412 | 412 | |
| 413 | 413 | namespace values |
| 414 | 414 | { |
| 415 | - std::basic_regex<char> integer_pattern | |
| 416 | - ("(-)?(0x)?([1-9a-zA-Z][0-9a-zA-Z]*)|(0)"); | |
| 415 | + namespace | |
| 416 | + { | |
| 417 | + std::basic_regex<char> integer_pattern | |
| 418 | + ("(-)?(0x)?([1-9a-zA-Z][0-9a-zA-Z]*)|(0)"); | |
| 419 | + } | |
| 417 | 420 | |
| 418 | 421 | namespace detail |
| 419 | 422 | { |
| ... | ... | @@ -530,48 +533,56 @@ namespace cxxopts |
| 530 | 533 | } |
| 531 | 534 | } |
| 532 | 535 | |
| 536 | + inline | |
| 533 | 537 | void |
| 534 | 538 | parse_value(const std::string& text, uint8_t& value) |
| 535 | 539 | { |
| 536 | 540 | integer_parser(text, value); |
| 537 | 541 | } |
| 538 | 542 | |
| 543 | + inline | |
| 539 | 544 | void |
| 540 | 545 | parse_value(const std::string& text, int8_t& value) |
| 541 | 546 | { |
| 542 | 547 | integer_parser(text, value); |
| 543 | 548 | } |
| 544 | 549 | |
| 550 | + inline | |
| 545 | 551 | void |
| 546 | 552 | parse_value(const std::string& text, uint16_t& value) |
| 547 | 553 | { |
| 548 | 554 | integer_parser(text, value); |
| 549 | 555 | } |
| 550 | 556 | |
| 557 | + inline | |
| 551 | 558 | void |
| 552 | 559 | parse_value(const std::string& text, int16_t& value) |
| 553 | 560 | { |
| 554 | 561 | integer_parser(text, value); |
| 555 | 562 | } |
| 556 | 563 | |
| 564 | + inline | |
| 557 | 565 | void |
| 558 | 566 | parse_value(const std::string& text, uint32_t& value) |
| 559 | 567 | { |
| 560 | 568 | integer_parser(text, value); |
| 561 | 569 | } |
| 562 | 570 | |
| 571 | + inline | |
| 563 | 572 | void |
| 564 | 573 | parse_value(const std::string& text, int32_t& value) |
| 565 | 574 | { |
| 566 | 575 | integer_parser(text, value); |
| 567 | 576 | } |
| 568 | 577 | |
| 578 | + inline | |
| 569 | 579 | void |
| 570 | 580 | parse_value(const std::string& text, uint64_t& value) |
| 571 | 581 | { |
| 572 | 582 | integer_parser(text, value); |
| 573 | 583 | } |
| 574 | 584 | |
| 585 | + inline | |
| 575 | 586 | void |
| 576 | 587 | parse_value(const std::string& text, int64_t& value) |
| 577 | 588 | { | ... | ... |