File tree 3 files changed +12
-12
lines changed
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -118,10 +118,10 @@ template <size_t Id, typename Name = void> struct captured_content {
118
118
}
119
119
120
120
#if __has_include(<charconv>)
121
- template <typename R = int > constexpr CTRE_FORCE_INLINE auto to_number (int base = 10 ) const noexcept -> R {
121
+ template <typename R = int , typename ... Ts > constexpr CTRE_FORCE_INLINE auto to_number (Ts && ... args ) const noexcept -> R {
122
122
R result{0 };
123
123
const auto view = to_view ();
124
- std::from_chars (view.data (), view.data () + view.size (), result, base );
124
+ std::from_chars (view.data (), view.data () + view.size (), result, std::forward<Ts>(args)... );
125
125
return result;
126
126
}
127
127
#endif
@@ -348,8 +348,8 @@ template <typename Iterator, typename... Captures> class regex_results {
348
348
}
349
349
350
350
#if __has_include(<charconv>)
351
- template <typename R = int > constexpr CTRE_FORCE_INLINE auto to_number (int base = 10 ) const noexcept -> R {
352
- return _captures.template select <0 >().template to_number <R>(base );
351
+ template <typename R = int , typename ... Ts > constexpr CTRE_FORCE_INLINE auto to_number (Ts && ... args ) const noexcept -> R {
352
+ return _captures.template select <0 >().template to_number <R>(std::forward<Ts>(args)... );
353
353
}
354
354
#endif
355
355
Original file line number Diff line number Diff line change @@ -3406,10 +3406,10 @@ template <size_t Id, typename Name = void> struct captured_content {
3406
3406
}
3407
3407
3408
3408
#if __has_include(<charconv>)
3409
- template <typename R = int> constexpr CTRE_FORCE_INLINE auto to_number(int base = 10 ) const noexcept -> R {
3409
+ template <typename R = int, typename... Ts > constexpr CTRE_FORCE_INLINE auto to_number(Ts && ... args ) const noexcept -> R {
3410
3410
R result{0};
3411
3411
const auto view = to_view();
3412
- std::from_chars(view.data(), view.data() + view.size(), result, base );
3412
+ std::from_chars(view.data(), view.data() + view.size(), result, std::forward<Ts>(args)... );
3413
3413
return result;
3414
3414
}
3415
3415
#endif
@@ -3636,8 +3636,8 @@ template <typename Iterator, typename... Captures> class regex_results {
3636
3636
}
3637
3637
3638
3638
#if __has_include(<charconv>)
3639
- template <typename R = int> constexpr CTRE_FORCE_INLINE auto to_number(int base = 10 ) const noexcept -> R {
3640
- return _captures.template select<0>().template to_number<R>(base );
3639
+ template <typename R = int, typename... Ts > constexpr CTRE_FORCE_INLINE auto to_number(Ts && ... args ) const noexcept -> R {
3640
+ return _captures.template select<0>().template to_number<R>(std::forward<Ts>(args)... );
3641
3641
}
3642
3642
#endif
3643
3643
Original file line number Diff line number Diff line change @@ -3403,10 +3403,10 @@ template <size_t Id, typename Name = void> struct captured_content {
3403
3403
}
3404
3404
3405
3405
#if __has_include(<charconv>)
3406
- template <typename R = int > constexpr CTRE_FORCE_INLINE auto to_number (int base = 10 ) const noexcept -> R {
3406
+ template <typename R = int , typename ... Ts > constexpr CTRE_FORCE_INLINE auto to_number (Ts && ... args ) const noexcept -> R {
3407
3407
R result{0 };
3408
3408
const auto view = to_view ();
3409
- std::from_chars (view.data (), view.data () + view.size (), result, base );
3409
+ std::from_chars (view.data (), view.data () + view.size (), result, std::forward<Ts>(args)... );
3410
3410
return result;
3411
3411
}
3412
3412
#endif
@@ -3633,8 +3633,8 @@ template <typename Iterator, typename... Captures> class regex_results {
3633
3633
}
3634
3634
3635
3635
#if __has_include(<charconv>)
3636
- template <typename R = int > constexpr CTRE_FORCE_INLINE auto to_number (int base = 10 ) const noexcept -> R {
3637
- return _captures.template select <0 >().template to_number <R>(base );
3636
+ template <typename R = int , typename ... Ts > constexpr CTRE_FORCE_INLINE auto to_number (Ts && ... args ) const noexcept -> R {
3637
+ return _captures.template select <0 >().template to_number <R>(std::forward<Ts>(args)... );
3638
3638
}
3639
3639
#endif
3640
3640
You can’t perform that action at this time.
0 commit comments