Skip to content

Commit

Permalink
fix for iosfwd/module interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
hanickadot committed May 16, 2024
1 parent 17e6c7d commit eb9577a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions include/ctre/return_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,13 @@ template <typename Iterator, typename... Captures> class regex_results {
return bool(rhs) ? lhs != rhs.view() : true;
}
friend CTRE_FORCE_INLINE std::ostream & operator<<(std::ostream & str, const regex_results & rhs) {
const auto view = rhs.view();
return str.write(view.data(), view.size());
#ifdef CTRE_IN_A_MODULE
auto view = rhs.view();
str.write(view.data(), view.size());
return str;
#else
return str << rhs.view();
#endif
}
};

Expand Down
9 changes: 7 additions & 2 deletions single-header/ctre-unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3834,8 +3834,13 @@ template <typename Iterator, typename... Captures> class regex_results {
return bool(rhs) ? lhs != rhs.view() : true;
}
friend CTRE_FORCE_INLINE std::ostream & operator<<(std::ostream & str, const regex_results & rhs) {
const auto view = rhs.view();
return str.write(view.data(), view.size());
#ifdef CTRE_IN_A_MODULE
auto view = rhs.view();
str.write(view.data(), view.size());
return str;
#else
return str << rhs.view();
#endif
}
};

Expand Down
9 changes: 7 additions & 2 deletions single-header/ctre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3831,8 +3831,13 @@ template <typename Iterator, typename... Captures> class regex_results {
return bool(rhs) ? lhs != rhs.view() : true;
}
friend CTRE_FORCE_INLINE std::ostream & operator<<(std::ostream & str, const regex_results & rhs) {
const auto view = rhs.view();
return str.write(view.data(), view.size());
#ifdef CTRE_IN_A_MODULE
auto view = rhs.view();
str.write(view.data(), view.size());
return str;
#else
return str << rhs.view();
#endif
}
};

Expand Down

0 comments on commit eb9577a

Please sign in to comment.