Skip to content

Commit 5eee678

Browse files
committed
Add default base to string2optional
So that direct usage of this function can be more succinct.
1 parent 742713f commit 5eee678

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/string2int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ auto wrap_string_conversion(do_conversiont do_conversion)
107107
/// (unsigned) long long
108108
/// does not accept negative inputs when the result type is unsigned
109109
template <typename T>
110-
optionalt<T> string2optional(const std::string &str, int base)
110+
optionalt<T> string2optional(const std::string &str, int base = 10)
111111
{
112112
return wrap_string_conversion([&]() {
113113
return narrow_or_throw_out_of_range<T>(string2optional_base<T>(str, base));

0 commit comments

Comments
 (0)