Skip to content

Commit

Permalink
rvalues should also be tested for writability, refs ericniebler/stl2#387
Browse files Browse the repository at this point in the history
  • Loading branch information
ericniebler committed Jul 1, 2017
1 parent dd7fd44 commit 779e98d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/range/v3/utility/iterator_concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ namespace ranges
using reference_t = Readable::reference_t<Out>;

template<typename Out, typename T>
auto requires_(Out& o, T &&t) -> decltype(
auto requires_(Out&& o, T &&t) -> decltype(
concepts::valid_expr(
((void)(*o = (T &&) t), 42),
((void)(const_cast<reference_t<Out> const &&>(*o) = (T &&)t), 42)
((void)(*((Out &&) o) = (T &&) t), 42),
((void)(const_cast<reference_t<Out> const &&>(*o) = (T &&)t), 42),
((void)(const_cast<reference_t<Out> const &&>(*((Out &&) o)) = (T &&)t), 42)
));
};

Expand Down

0 comments on commit 779e98d

Please sign in to comment.