Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[range.chunk.by.view] Should the help function find-next/find-prev of chunk_by_view be private? #5484

Open
hewillk opened this issue May 22, 2022 · 2 comments

Comments

@hewillk
Copy link
Contributor

hewillk commented May 22, 2022

From [range.chunk.by.view]

namespace std::ranges {
template<forward_range V, indirect_­binary_­predicate<iterator_t<V>, iterator_t<V>> Pred>
  requires view<V> && is_object_v<Pred>
class chunk_by_view : public view_interface<chunk_by_view<V, Pred>> {
  // ...

public:
  chunk_by_view() requires default_­initializable<V> && default_­initializable<Pred> = default;
  constexpr explicit chunk_by_view(V base, Pred pred);

  constexpr V base() const & requires copy_­constructible<V> { return base_; }
  constexpr V base() && { return std::move(base_); }

  constexpr const Pred& pred() const;

  constexpr iterator begin();
  constexpr auto end();

  constexpr iterator_t<V> find-next(iterator_t<V>);                 // exposition only
  constexpr iterator_t<V> find-prev(iterator_t<V>)                  // exposition only
    requires bidirectional_­range<V>;
};

Although find-next and find-prev are exposition only, is it more appropriate to move them to the private block?

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Mar 31, 2023

They are used in "Effects: Equivalent to" in the specification of the iterator. It seems to me that the reason of making them public is to avoid the potentially ill-formedness caused by access control.

I guess there should be a general rule - exposition-only members in the library specification are considered accessible from other entities in the standard library, but not from programs (user codes).

@JohelEGP
Copy link
Contributor

I guess there should be a general rule - exposition-only members in the library specification are considered accessible from other entities in the standard library, but not from programs (user codes).

See #5428 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants