Skip to content

Commit a639ebc

Browse files
author
Hana Dusíková
committed
update for pattern matching :)
1 parent e0afaab commit a639ebc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/ctre/functions.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ template <typename RE> struct regex_match_t {
5151
auto re_obj = ctre::regular_expression<RE>();
5252
return re_obj.match(std::forward<Args>(args)...);
5353
}
54+
template <typename... Args> CTRE_FORCE_INLINE constexpr auto try_extract(Args && ... args) const noexcept {
55+
return operator()(std::forward<Args>(args)...);
56+
}
5457
};
5558

5659
template <typename RE> struct regex_search_t {
5760
template <typename... Args> CTRE_FORCE_INLINE constexpr auto operator()(Args && ... args) const noexcept {
5861
auto re_obj = ctre::regular_expression<RE>();
5962
return re_obj.search(std::forward<Args>(args)...);
6063
}
64+
template <typename... Args> CTRE_FORCE_INLINE constexpr auto try_extract(Args && ... args) const noexcept {
65+
return operator()(std::forward<Args>(args)...);
66+
}
6167
};
6268

6369
#if __cpp_nontype_template_parameter_class

0 commit comments

Comments
 (0)