Skip to content

Commit 30fbcc2

Browse files
committed
Disable operator_brackets_proxy assignment if reference is not assignable.
Use SFINAE to disable operator_brackets_proxy assignment operator is reference is not assignable from the assignment argument. Also fix the iterator type in std::declval in noexcept specification.
1 parent e968c33 commit 30fbcc2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

include/boost/iterator/iterator_facade.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,14 @@ class operator_brackets_proxy
360360

361361
template< typename T >
362362
typename std::enable_if<
363-
!std::is_same<
364-
operator_brackets_proxy< Iterator >,
365-
typename std::remove_cv< typename std::remove_reference< T >::type >::type
363+
detail::conjunction<
364+
detail::negation<
365+
std::is_same<
366+
operator_brackets_proxy< Iterator >,
367+
typename std::remove_cv< typename std::remove_reference< T >::type >::type
368+
>
369+
>,
370+
std::is_assignable< reference, T&& >
366371
>::value,
367372
operator_brackets_proxy&
368373
>::type operator= (T&& val) noexcept(noexcept(*std::declval< Iterator const& >() = std::declval< T&& >()))

0 commit comments

Comments
 (0)