Skip to content

Commit

Permalink
[std] Index specializations of range variable templates
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Apr 20, 2022
1 parent a8dbfc6 commit da20ac9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14311,9 +14311,9 @@
template<class ElementType, size_t Extent = dynamic_extent>
class span;

template<class ElementType, size_t Extent>
template<class ElementType, size_t Extent> @\indexlibraryspec{enable_view}{span}@
inline constexpr bool ranges::enable_view<span<ElementType, Extent>> = true;
template<class ElementType, size_t Extent>
template<class ElementType, size_t Extent> @\indexlibraryspec{enable_borrowed_range}{span}@
inline constexpr bool ranges::enable_borrowed_range<span<ElementType, Extent>> = true;

// \ref{span.objectrep}, views of object representation
Expand Down
8 changes: 4 additions & 4 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12671,14 +12671,14 @@
}

namespace std::ranges {
template<>
template<> @\indexlibraryspec{enable_borrowed_range}{directory_iterator}@
inline constexpr bool enable_borrowed_range<filesystem::directory_iterator> = true;
template<>
template<> @\indexlibraryspec{enable_borrowed_range}{recursive_directory_iterator}@
inline constexpr bool enable_borrowed_range<filesystem::recursive_directory_iterator> = true;

template<>
template<> @\indexlibraryspec{enable_view}{directory_iterator}@
inline constexpr bool enable_view<filesystem::directory_iterator> = true;
template<>
template<> @\indexlibraryspec{enable_view}{recursive_directory_iterator}@
inline constexpr bool enable_view<filesystem::recursive_directory_iterator> = true;
}
\end{codeblock}
Expand Down
2 changes: 1 addition & 1 deletion source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
template<class Iterator>
constexpr reverse_iterator<Iterator> make_reverse_iterator(Iterator i);

template<class Iterator1, class Iterator2>
template<class Iterator1, class Iterator2> @\indexlibraryspec{disable_sized_sentinel_for}{reverse_iterator}@
requires (!@\libconcept{sized_sentinel_for}@<Iterator1, Iterator2>)
inline constexpr bool disable_sized_sentinel_for<reverse_iterator<Iterator1>,
reverse_iterator<Iterator2>> = true;
Expand Down
1 change: 1 addition & 0 deletions source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
\newcommand{\indexlibraryglobal}[1]{\indexlibrary{\idxcode{#1}}}
\newcommand{\indexlibraryctor}[1]{\indexlibrarymisc{#1}{constructor}}
\newcommand{\indexlibrarydtor}[1]{\indexlibrarymisc{#1}{destructor}}
\newcommand{\indexlibraryspec}[2]{\indexlibrary{\idxcode{#1}!\idxcode{#2}}}

% class member library index
\newcommand{\indexlibrarymemberx}[2]{\indexlibrarymisc{#1}{\idxcode{#2}}}
Expand Down
30 changes: 15 additions & 15 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
requires (K == subrange_kind::sized || !@\libconcept{sized_sentinel_for}@<S, I>)
class subrange;

template<class I, class S, subrange_kind K>
template<class I, class S, subrange_kind K> @\indexlibraryspec{enable_borrowed_range}{subrange}@
inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true;

// \ref{range.dangling}, dangling iterator handling
Expand All @@ -154,7 +154,7 @@
requires is_object_v<T>
class empty_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{empty_view}@
inline constexpr bool enable_borrowed_range<empty_view<T>> = true;

namespace views {
Expand All @@ -177,7 +177,7 @@
requires @\exposconcept{weakly-equality-comparable-with}@<W, Bound> && @\libconcept{copyable}@<W>
class iota_view;

template<class W, class Bound>
template<class W, class Bound> @\indexlibraryspec{enable_borrowed_range}{iota_view}@
inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true;

namespace views { inline constexpr @\unspec@ iota = @\unspec@; }
Expand Down Expand Up @@ -210,15 +210,15 @@
requires is_object_v<R>
class ref_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{ref_view}@
inline constexpr bool enable_borrowed_range<ref_view<T>> = true;

// \ref{range.owning.view}, owning view
template<range R>
requires @\seebelow@
class owning_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{owning_view}@
inline constexpr bool enable_borrowed_range<owning_view<T>> = enable_borrowed_range<T>;

// \ref{range.filter}, filter view
Expand All @@ -240,7 +240,7 @@
// \ref{range.take}, take view
template<@\libconcept{view}@> class take_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{take_view}@
inline constexpr bool enable_borrowed_range<take_view<T>> = enable_borrowed_range<T>;

namespace views { inline constexpr @\unspec@ take = @\unspec@; }
Expand All @@ -257,7 +257,7 @@
template<@\libconcept{view}@ V>
class drop_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{drop_view}@
inline constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>;

namespace views { inline constexpr @\unspec@ drop = @\unspec@; }
Expand All @@ -268,7 +268,7 @@
@\libconcept{indirect_unary_predicate}@<const Pred, iterator_t<V>>
class drop_while_view;

template<class T, class Pred>
template<class T, class Pred> @\indexlibraryspec{enable_borrowed_range}{drop_while_view}@
inline constexpr bool enable_borrowed_range<drop_while_view<T, Pred>> =
enable_borrowed_range<T>;

Expand Down Expand Up @@ -322,7 +322,7 @@
requires (!@\libconcept{common_range}@<V> && @\libconcept{copyable}@<iterator_t<V>>)
class common_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{common_view}@
inline constexpr bool enable_borrowed_range<common_view<T>> = enable_borrowed_range<T>;

namespace views { inline constexpr @\unspec@ common = @\unspec@; }
Expand All @@ -332,7 +332,7 @@
requires @\libconcept{bidirectional_range}@<V>
class reverse_view;

template<class T>
template<class T> @\indexlibraryspec{enable_borrowed_range}{reverse_view}@
inline constexpr bool enable_borrowed_range<reverse_view<T>> = enable_borrowed_range<T>;

namespace views { inline constexpr @\unspec@ reverse = @\unspec@; }
Expand All @@ -342,7 +342,7 @@
requires @\seebelow@
class elements_view;

template<class T, size_t N>
template<class T, size_t N> @\indexlibraryspec{enable_borrowed_range}{elements_view}@
inline constexpr bool enable_borrowed_range<elements_view<T, N>> = enable_borrowed_range<T>;

template<class R>
Expand All @@ -362,7 +362,7 @@
requires (@\libconcept{view}@<Views> && ...) && (sizeof...(Views) > 0)
class zip_view;

template<class... Views>
template<class... Views> @\indexlibraryspec{enable_borrowed_range}{zip_view}@
inline constexpr bool enable_borrowed_range<zip_view<Views...>> =
(enable_borrowed_range<Views> && ...);

Expand All @@ -382,7 +382,7 @@
requires @\libconcept{view}@<V> && (N > 0)
class adjacent_view;

template<class V, size_t N>
template<class V, size_t N> @\indexlibraryspec{enable_borrowed_range}{adjacent_view}@
inline constexpr bool enable_borrowed_range<adjacent_view<V, N>> =
enable_borrowed_range<V>;

Expand Down Expand Up @@ -412,7 +412,7 @@
requires @\libconcept{forward_range}@<V>
class chunk_view<V>;

template<class V>
template<class V> @\indexlibraryspec{enable_borrowed_range}{chunk_view}@
inline constexpr bool enable_borrowed_range<chunk_view<V>> =
@\libconcept{forward_range}@<V> && enable_borrowed_range<V>;

Expand All @@ -423,7 +423,7 @@
requires @\libconcept{forward_range}@<V>
class slide_view;

template<class V>
template<class V> @\indexlibraryspec{enable_borrowed_range}{slide_view}@
inline constexpr bool enable_borrowed_range<slide_view<V>> =
enable_borrowed_range<V>;

Expand Down
4 changes: 2 additions & 2 deletions source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@
template<class charT, class traits = char_traits<charT>>
class basic_string_view;

template<class charT, class traits>
template<class charT, class traits> @\indexlibraryspec{enable_view}{basic_string_view}@
inline constexpr bool ranges::enable_view<basic_string_view<charT, traits>> = true;
template<class charT, class traits>
template<class charT, class traits> @\indexlibraryspec{enable_borrowed_range}{basic_string_view}@
inline constexpr bool ranges::enable_borrowed_range<basic_string_view<charT, traits>> = true;

// \ref{string.view.comparison}, non-member comparison functions
Expand Down

0 comments on commit da20ac9

Please sign in to comment.