Skip to content

Commit

Permalink
properly rangyfi ctre
Browse files Browse the repository at this point in the history
  • Loading branch information
Hana Dusíková committed Apr 17, 2021
1 parent db3bcf5 commit 95c6386
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions include/ctre/range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ template <typename Range, typename RE> struct multi_subject_range {
last_type last{};
value_type current_result{};

constexpr CTRE_FORCE_INLINE iterator() noexcept = default;
constexpr CTRE_FORCE_INLINE iterator(first_type f, last_type l) noexcept: first{f}, last{l}, current_result{find_first()} { }

constexpr CTRE_FORCE_INLINE value_type find_first() noexcept {
Expand Down Expand Up @@ -113,8 +114,9 @@ template <typename Range, typename RE> struct multi_subject_range {
}
};

Range range;
Range range{};

constexpr CTRE_FORCE_INLINE multi_subject_range() noexcept = default;
constexpr CTRE_FORCE_INLINE multi_subject_range(Range r) noexcept: range{r} { }

constexpr CTRE_FORCE_INLINE auto begin() const noexcept {
Expand All @@ -136,7 +138,8 @@ namespace std::ranges {

template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_range<Ts...>> = true;
template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_split_range<Ts...>> = true;
template <typename Range, typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::multi_subject_range<Range, Ts...>> = enable_borrowed_range<Range>;
template <typename Range, typename RE> inline constexpr bool enable_borrowed_range<::ctre::multi_subject_range<Range, RE>> = enable_borrowed_range<Range>;
template <typename Range, typename RE> inline constexpr bool enable_view<::ctre::multi_subject_range<Range, RE>> = true;

}
#endif
Expand Down
7 changes: 5 additions & 2 deletions single-header/ctre-unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4686,6 +4686,7 @@ template <typename Range, typename RE> struct multi_subject_range {
last_type last{};
value_type current_result{};

constexpr CTRE_FORCE_INLINE iterator() noexcept = default;
constexpr CTRE_FORCE_INLINE iterator(first_type f, last_type l) noexcept: first{f}, last{l}, current_result{find_first()} { }

constexpr CTRE_FORCE_INLINE value_type find_first() noexcept {
Expand Down Expand Up @@ -4743,8 +4744,9 @@ template <typename Range, typename RE> struct multi_subject_range {
}
};

Range range;
Range range{};

constexpr CTRE_FORCE_INLINE multi_subject_range() noexcept = default;
constexpr CTRE_FORCE_INLINE multi_subject_range(Range r) noexcept: range{r} { }

constexpr CTRE_FORCE_INLINE auto begin() const noexcept {
Expand All @@ -4765,7 +4767,8 @@ namespace std::ranges {

template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_range<Ts...>> = true;
template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_split_range<Ts...>> = true;
template <typename Range, typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::multi_subject_range<Range, Ts...>> = enable_borrowed_range<Range>;
template <typename Range, typename RE> inline constexpr bool enable_borrowed_range<::ctre::multi_subject_range<Range, RE>> = enable_borrowed_range<Range>;
template <typename Range, typename RE> inline constexpr bool enable_view<::ctre::multi_subject_range<Range, RE>> = true;

}
#endif
Expand Down
7 changes: 5 additions & 2 deletions single-header/ctre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4683,6 +4683,7 @@ template <typename Range, typename RE> struct multi_subject_range {
last_type last{};
value_type current_result{};

constexpr CTRE_FORCE_INLINE iterator() noexcept = default;
constexpr CTRE_FORCE_INLINE iterator(first_type f, last_type l) noexcept: first{f}, last{l}, current_result{find_first()} { }

constexpr CTRE_FORCE_INLINE value_type find_first() noexcept {
Expand Down Expand Up @@ -4740,8 +4741,9 @@ template <typename Range, typename RE> struct multi_subject_range {
}
};

Range range;
Range range{};

constexpr CTRE_FORCE_INLINE multi_subject_range() noexcept = default;
constexpr CTRE_FORCE_INLINE multi_subject_range(Range r) noexcept: range{r} { }

constexpr CTRE_FORCE_INLINE auto begin() const noexcept {
Expand All @@ -4762,7 +4764,8 @@ namespace std::ranges {

template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_range<Ts...>> = true;
template <typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::regex_split_range<Ts...>> = true;
template <typename Range, typename... Ts> inline constexpr bool enable_borrowed_range<::ctre::multi_subject_range<Range, Ts...>> = enable_borrowed_range<Range>;
template <typename Range, typename RE> inline constexpr bool enable_borrowed_range<::ctre::multi_subject_range<Range, RE>> = enable_borrowed_range<Range>;
template <typename Range, typename RE> inline constexpr bool enable_view<::ctre::multi_subject_range<Range, RE>> = true;

}
#endif
Expand Down

0 comments on commit 95c6386

Please sign in to comment.