8000 Sentinels should not be required to be default constructible · Issue #613 · cpp-ru/ideas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Sentinels should not be required to be default constructible #613
Open
@Makcal

Description

@Makcal

Заменить

template< class S, class I >
    concept sentinel_for =
        std::semiregular<S> &&
        std::input_or_output_iterator<I> &&
        __WeaklyEqualityComparableWith<S, I>;

на

template< class S, class I >
    concept sentinel_for =
        std::copyable<S> &&
        std::input_or_output_iterator<I> &&
        __WeaklyEqualityComparableWith<S, I>;

, тем самым убрав требование на default constructible, тем же образом, каким P2325R3 убрало это требование из итераторов. Аналогично P2325R3, в этом требовании нет особого смысла, но зато итераторы, возвращаемые из .end(), которые не являются default constructible, не могут быть использованы в std::ranges::end, что мешает некоторым диапазонам удовлетворять std::ranges::range (я лично столкнулся с этим в библиотеке sqlpp11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0