Skip to content

Commit

Permalink
add comment and (hopefully) fix for #296 and avoiding all traps around
Browse files Browse the repository at this point in the history
  • Loading branch information
hanickadot committed Oct 14, 2023
1 parent 7ae68da commit c4a7129
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/ctre/return_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ template <size_t Id, typename Name = void> struct captured_content {
return _matched;
}

template <typename It = Iterator> constexpr CTRE_FORCE_INLINE const auto * data_unsafe() const noexcept {
template <typename It = Iterator> constexpr CTRE_FORCE_INLINE const auto * data_unsafe() const noexcept {
static_assert(!is_reverse_iterator<It>, "Iterator in your capture must not be reverse!");

#if __cpp_char8_t >= 201811
Expand All @@ -83,7 +83,7 @@ template <size_t Id, typename Name = void> struct captured_content {
#endif

#ifdef _MSC_VER
return std::to_address(_begin);
return std::to_address(_begin); // I'm enabling this only for MSVC for now, as some clang old versions with various libraries (random combinations) has different problems
#else
return &*_begin;
#endif
Expand Down
4 changes: 2 additions & 2 deletions single-header/ctre-unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3361,7 +3361,7 @@ template <size_t Id, typename Name = void> struct captured_content {
return _matched;
}

template <typename It = Iterator> constexpr CTRE_FORCE_INLINE const auto * data_unsafe() const noexcept {
template <typename It = Iterator> constexpr CTRE_FORCE_INLINE const auto * data_unsafe() const noexcept {
static_assert(!is_reverse_iterator<It>, "Iterator in your capture must not be reverse!");

#if __cpp_char8_t >= 201811
Expand All @@ -3371,7 +3371,7 @@ template <size_t Id, typename Name = void> struct captured_content {
#endif

#ifdef _MSC_VER
return std::to_address(_begin);
return std::to_address(_begin); // I'm enabling this only for MSVC for now, as some clang old versions with various libraries (random combinations) has different problems
#else
return &*_begin;
#endif
Expand Down
4 changes: 2 additions & 2 deletions single-header/ctre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,7 @@ template <size_t Id, typename Name = void> struct captured_content {
return _matched;
}

template <typename It = Iterator> constexpr CTRE_FORCE_INLINE const auto * data_unsafe() const noexcept {
template <typename It = Iterator> constexpr CTRE_FORCE_INLINE const auto * data_unsafe() const noexcept {
static_assert(!is_reverse_iterator<It>, "Iterator in your capture must not be reverse!");

#if __cpp_char8_t >= 201811
Expand All @@ -3368,7 +3368,7 @@ template <size_t Id, typename Name = void> struct captured_content {
#endif

#ifdef _MSC_VER
return std::to_address(_begin);
return std::to_address(_begin); // I'm enabling this only for MSVC for now, as some clang old versions with various libraries (random combinations) has different problems
#else
return &*_begin;
#endif
Expand Down

0 comments on commit c4a7129

Please sign in to comment.