2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-19 04:22:13 +00:00

Pass the sentinel type as a template parameter to the iterator template in

project_view, as a workaround to the presence/absence of a disambiguating
template keyword in iterator's implementation.  Neither adding it nor temoving
it works for all builds.  Also, re-enable the C++17 MSVC 2022 Github build.

Fixes #252.
This commit is contained in:
Zach Laine
2025-07-26 20:58:50 -05:00
parent b2927abc6c
commit 39faa9ddbe
2 changed files with 8 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cxx_std: [20, 23]
cxx_std: [17, 20, 23]
os: [windows-2022]
runs-on: ${{ matrix.os }}

View File

@@ -88,12 +88,14 @@ namespace boost::parser::detail { namespace text {
{
V base_ = V();
public:
template<bool Const>
class iterator;
// HACK: SentType is here to work around irritating big-3
// implementation inconsistencies.
template<bool Const>
class sentinel;
template<bool Const, typename SentType = sentinel<Const>>
class iterator;
public:
constexpr project_view()
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
requires std::default_initializable<V>
@@ -140,7 +142,7 @@ namespace boost::parser::detail { namespace text {
#else
template<typename V, typename F>
#endif
template<bool Const>
template<bool Const, typename SentType>
class project_view<V, F>::iterator
: public boost::parser::detail::stl_interfaces::proxy_iterator_interface<
iterator<Const>,
@@ -161,7 +163,7 @@ namespace boost::parser::detail { namespace text {
decltype(detail::function_for_tag<F>(0))
#endif
;
using sentinel = project_view<V, F>::template sentinel<Const>;
using sentinel = SentType;
friend boost::parser::detail::stl_interfaces::access;
iterator_type & base_reference() noexcept { return it_; }