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 Jan 21, 2022
1 parent ba9124e commit 807fbbd
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11043,9 +11043,9 @@
class span;

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

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

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

template<>
inline constexpr bool enable_view<filesystem::directory_iterator> = true;
inline constexpr bool @\deflibspec{enable_view}{<filesystem::}{directory_iterator}@> = true;
template<>
inline constexpr bool enable_view<filesystem::recursive_directory_iterator> = true;
inline constexpr bool @\deflibspec{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 @@ -316,7 +316,7 @@

template<class Iterator1, class Iterator2>
requires (!@\libconcept{sized_sentinel_for}@<Iterator1, Iterator2>)
inline constexpr bool disable_sized_sentinel_for<reverse_iterator<Iterator1>,
inline constexpr bool @\deflibspec{disable_sized_sentinel_for}{<}{reverse_iterator}@<Iterator1>,
reverse_iterator<Iterator2>> = true;

// \ref{insert.iterators}, insert iterators
Expand Down
2 changes: 2 additions & 0 deletions source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
\newcommand{\indexlibraryglobal}[1]{\indexlibrary{\idxcode{#1}}}
\newcommand{\indexlibraryctor}[1]{\indexlibrarymisc{#1}{constructor}}
\newcommand{\indexlibrarydtor}[1]{\indexlibrarymisc{#1}{destructor}}
\newcommand{\indexlibraryspec}[2]{\indexlibrarymisc{#1}{\idxcode{#2}}}
\newcommand{\deflibspec}[3]{\tcode{#1#2#3}\indexlibraryspec{#1}{#3}}

% class member library index
\newcommand{\indexlibrarymemberx}[2]{\indexlibrarymisc{#1}{\idxcode{#2}}}
Expand Down
26 changes: 13 additions & 13 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
class subrange;

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

// \ref{range.dangling}, dangling iterator handling
struct dangling;
Expand All @@ -145,7 +145,7 @@
class empty_view;

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

namespace views {
template<class T>
Expand All @@ -168,7 +168,7 @@
class iota_view;

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

namespace views { inline constexpr @\unspec@ iota = @\unspec@; }

Expand Down Expand Up @@ -196,15 +196,15 @@
class ref_view;

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

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

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

// \ref{range.filter}, filter view
template<@\libconcept{input_range}@ V, @\libconcept{indirect_unary_predicate}@<iterator_t<V>> Pred>
Expand All @@ -226,7 +226,7 @@
template<@\libconcept{view}@> class take_view;

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

namespace views { inline constexpr @\unspec@ take = @\unspec@; }

Expand All @@ -243,7 +243,7 @@
class drop_view;

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

namespace views { inline constexpr @\unspec@ drop = @\unspec@; }

Expand All @@ -254,7 +254,7 @@
class drop_while_view;

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

namespace views { inline constexpr @\unspec@ drop_while = @\unspec@; }
Expand Down Expand Up @@ -296,7 +296,7 @@
class common_view;

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

namespace views { inline constexpr @\unspec@ common = @\unspec@; }

Expand All @@ -306,7 +306,7 @@
class reverse_view;

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

namespace views { inline constexpr @\unspec@ reverse = @\unspec@; }

Expand All @@ -316,7 +316,7 @@
class elements_view;

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

template<class R>
using @\libglobal{keys_view}@ = elements_view<R, 0>;
Expand All @@ -336,7 +336,7 @@
class zip_view;

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

namespace views { inline constexpr @\unspec@ zip = @\unspec@; }
Expand All @@ -356,7 +356,7 @@
class adjacent_view;

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

namespace views {
Expand Down
4 changes: 2 additions & 2 deletions source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4057,9 +4057,9 @@
class basic_string_view;

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

// \ref{string.view.comparison}, non-member comparison functions
template<class charT, class traits>
Expand Down

0 comments on commit 807fbbd

Please sign in to comment.