Can’t create std::ranges::subrange with my iterator

I am trying to define an iterator that iterates through a puzzle game board cells by a given starting cell and some link representing some kind of a connection between the cells. Below I provided a sample code with the same methods but a trivial implementation that potentially should iterate over the cells with the coordinates {0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}:

#include <ranges>

struct CellCoord { size_t col; size_t row; };

struct NeighborIteratorSentinel {};

class NeighborIterator
{
public:

    NeighborIterator(size_t link_id) :
        linkId(link_id)
    {}

    using iterator_category = std::forward_iterator_tag;

    using value_type = CellCoord;

    using difference_type = std::ptrdiff_t;

    using pointer = value_type*;

    using reference = value_type&;

    CellCoord operator-> () const { return cur(); }

    CellCoord operator* () const { return cur(); }

    NeighborIterator& operator++ ()
    {
        ++linkId;

        return *this;
    }

    NeighborIterator operator++ (int)
    {
        NeighborIterator tmp = *this;

        ++linkId;

        return tmp;
    }

    NeighborIterator(const NeighborIterator& other) = default;
    NeighborIterator(NeighborIterator&& other) = default;

    NeighborIterator& operator = (const NeighborIterator& other) = default;
    NeighborIterator& operator = (NeighborIterator&& other) = default;

    NeighborIterator& operator = (const NeighborIteratorSentinel&)
    {
        linkId = linkCount;
    }

    NeighborIterator& operator = (NeighborIteratorSentinel&&)
    {
        linkId = linkCount;
    }

    bool operator == (const NeighborIterator& r) const noexcept
    {
        return linkId == r.linkId;
    }

    bool operator != (const NeighborIterator& r)  const noexcept
    {
        return !operator == (r);
    }

    bool operator == (const NeighborIteratorSentinel&) const noexcept
    {
        return linkId == linkCount;
    }

    bool operator != (const NeighborIteratorSentinel& r)  const noexcept
    {
        return !operator == (r);
    }

protected:

    CellCoord cur() const
    {
        return {linkId, linkId};
    }

private:

    size_t linkId;

    static constexpr size_t linkCount = 5;
};

The problem is that I can’t compile the following method:

inline auto MakeNeighborRange()
{
    return std::ranges::subrange<NeighborIterator, NeighborIteratorSentinel>(NeighborIterator(0u), NeighborIteratorSentinel{});
}

because std::sentinel_for constraint is not satisfied.

How to make this compile? What does this constraint wand of me?

MSVC output:

C:devtemp>cl /std:c++20 /EHsc NeighborIterator.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

NeighborIterator.cpp
NeighborIterator.cpp(101): error C7602: 'std::ranges::subrange': the associated constraints are not satisfied
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(3735): note: see declaration of 'std::ranges::subrange'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(3733): note: the concept 'std::sentinel_for<example::NeighborIteratorSentinel,example::NeighborIterator>' evaluated to false
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519include__msvc_iter_core.hpp(421): note: the concept 'std::_Weakly_equality_comparable_with<example::NeighborIteratorSentinel,example::NeighborIterator>' evaluated to false
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(193): note: the concept 'std::_Half_equality_comparable<example::NeighborIteratorSentinel,example::NeighborIterator>' evaluated to false
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(187): note: 'bool example::NeighborIterator::operator ==(const example::NeighborIteratorSentinel &) noexcept const': rewritten candidate function was excluded from overload resolution because a corresponding operator!= declared in the same scope
NeighborIterator.cpp(75): note: could be 'bool example::NeighborIterator::operator ==(const example::NeighborIteratorSentinel &) noexcept const' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(187): note: 'bool example::NeighborIterator::operator ==(const example::NeighborIteratorSentinel &) noexcept const': rewritten candidate function was excluded from overload resolution because a corresponding operator!= declared in the same scope
NeighborIterator.cpp(65): note: or 'bool example::NeighborIterator::operator ==(const example::NeighborIterator &) noexcept const' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(187): note: 'bool example::NeighborIterator::operator ==(const example::NeighborIterator &) noexcept const': cannot convert argument 2 from 'const example::NeighborIteratorSentinel' to 'const example::NeighborIterator &'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(187): note: Reason: cannot convert from 'const example::NeighborIteratorSentinel' to 'const example::NeighborIterator'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(187): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(5047): note: or       'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem *const ) noexcept'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(5041): note: or       'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const std::basic_string<_Elem,_Traits,_Alloc> &) noexcept'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(1661): note: or       'bool std::operator ==(const std::basic_string_view<_Elem,_Traits>,const _Identity<std::basic_string_view<_Elem,_Traits>>::type) noexcept'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(1647): note: or       'bool std::operator ==(const std::basic_string_view<_Elem,_Traits>,const std::basic_string_view<_Elem,_Traits>) noexcept'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexmemory(1042): note: or       'bool std::operator ==(const std::allocator<_Ty> &,const std::allocator<_Other> &) noexcept'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includetuple(872): note: or       'bool std::operator ==(const std::tuple<_Types...> &,const std::tuple<_Types...> &)'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeiterator(488): note: or       'bool std::operator ==(const std::istreambuf_iterator<_Elem,_Traits> &,const std::istreambuf_iterator<_Elem,_Traits> &)'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeiterator(306): note: or       'bool std::operator ==(const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &,const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &) noexcept'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(4228): note: or       'bool std::operator ==(const std::move_iterator<_Iter> &,const std::move_iterator<_Iter2> &) noexcept(<expr>)'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(1686): note: or       'bool std::operator ==(const std::reverse_iterator<_BidIt> &,const std::reverse_iterator<_BidIt2> &) noexcept(<expr>)'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeutility(490): note: or       'bool std::operator ==(const std::pair<_Ty1,_Ty2> &,const std::pair<_Uty1,_Uty2> &)'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeutility(490): note: or 'bool std::operator ==(const std::pair<_Ty1,_Ty2> &,const std::pair<_Uty1,_Uty2> &)' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(1686): note: or 'bool std::operator ==(const std::reverse_iterator<_BidIt> &,const std::reverse_iterator<_BidIt2> &) noexcept(<expr>)' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(4228): note: or 'bool std::operator ==(const std::move_iterator<_Iter> &,const std::move_iterator<_Iter2> &) noexcept(<expr>)' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeiterator(306): note: or 'bool std::operator ==(const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &,const std::istream_iterator<_Ty,_Elem,_Traits,_Diff> &) noexcept' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeiterator(488): note: or 'bool std::operator ==(const std::istreambuf_iterator<_Elem,_Traits> &,const std::istreambuf_iterator<_Elem,_Traits> &)' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includetuple(872): note: or 'bool std::operator ==(const std::tuple<_Types...> &,const std::tuple<_Types...> &)' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexmemory(1042): note: or 'bool std::operator ==(const std::allocator<_Ty> &,const std::allocator<_Other> &) noexcept' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(1647): note: or 'bool std::operator ==(const std::basic_string_view<_Elem,_Traits>,const std::basic_string_view<_Elem,_Traits>) noexcept' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(1661): note: or 'bool std::operator ==(const std::basic_string_view<_Elem,_Traits>,const _Identity<std::basic_string_view<_Elem,_Traits>>::type) noexcept' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(5041): note: or 'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const std::basic_string<_Elem,_Traits,_Alloc> &) noexcept' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexstring(5047): note: or 'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem *const ) noexcept' [synthesized expression 'y == x']
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includeconcepts(187): note: while trying to match the argument list '(const example::NeighborIteratorSentinel, const example::NeighborIterator)'
NeighborIterator.cpp(101): error C2641: cannot deduce template arguments for 'std::ranges::subrange'
NeighborIterator.cpp(101): error C2783: 'std::ranges::subrange<_It,_Se,_Ki> std::ranges::subrange(std::true_type,_Rng &&)': could not deduce template argument for '_It'
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(3745): note: see declaration of 'std::ranges::subrange'
NeighborIterator.cpp(101): error C2780: 'std::ranges::subrange<_It,_Se,_Ki> std::ranges::subrange(std::ranges::subrange<_It,_Se,_Ki>)': expects 1 arguments - 2 provided
C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519includexutility(3735): note: see declaration of 'std::ranges::subrange'

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật