Skip to content

Commit

Permalink
PR for #299
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdb authored and CaseyCarter committed Jul 18, 2017
1 parent 890fce8 commit 79bb538
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,10 @@
template <class T>
requires requires { typename T::element_type; }
struct value_type<T>
: enable_if<is_object<typename T::element_type>::value, typename T::element_type> { };
: enable_if<
is_object<typename T::element_type>::value,
remove_cv_t<typename T::element_type>>
{ };

template <class T> using value_type_t
= typename value_type<T>::type;
Expand All @@ -884,7 +887,8 @@
\pnum
When instantiated with a type \tcode{I}
such that \tcode{I::element_type} is valid and denotes a type,
\tcode{value_type<I>::type} names that type, unless it is not an object type~(\cxxref{basic.types}) in which case
\tcode{value_type<I>::type} names the type \tcode{remove_cv_t<I::element_type>}, unless it is
not an object type~(\cxxref{basic.types}) in which case
\tcode{value_type<I>} shall have no nested type \tcode{type}. \enternote Smart pointers like
\tcode{shared_ptr<int>} are \tcode{Readable} and have an associated value type. But a smart pointer
like \tcode{shared_ptr<void>} is not \tcode{Readable} and has no associated value type.\exitnote
Expand Down

0 comments on commit 79bb538

Please sign in to comment.