mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
Using ADL everywhere for lexical_cast (#820)
* Using ADL everywhere for lexical_cast * Fixes in docs * Add a test for old extension mechanism * style: pre-commit.ci fixes * Make gcc happy Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Philip Top <phlptp@gmail.com>
This commit is contained in:
@@ -8,9 +8,9 @@ classes or inheritance. This is accomplished through lambda functions.
|
||||
This looks like:
|
||||
|
||||
```cpp
|
||||
Option* add_option(string name, T item) {
|
||||
Option* add_option(string name, T &item) {
|
||||
this->function = [&item](string value){
|
||||
item = detail::lexical_cast<T>(value);
|
||||
return lexical_cast(value, item);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user