mirror of
https://github.com/boostorg/iterator.git
synced 2025-06-25 03:51:33 +02:00
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.
This commit is contained in:
@ -360,12 +360,17 @@ public:
|
||||
|
||||
template< typename T >
|
||||
typename std::enable_if<
|
||||
!std::is_same<
|
||||
operator_brackets_proxy< Iterator >,
|
||||
typename std::remove_cv< typename std::remove_reference< T >::type >::type
|
||||
detail::conjunction<
|
||||
detail::negation<
|
||||
std::is_same<
|
||||
operator_brackets_proxy< Iterator >,
|
||||
typename std::remove_cv< typename std::remove_reference< T >::type >::type
|
||||
>
|
||||
>,
|
||||
std::is_assignable< reference, T&& >
|
||||
>::value,
|
||||
operator_brackets_proxy&
|
||||
>::type operator= (T&& val) noexcept(noexcept(*std::declval< Iterator const& >() = std::declval< T&& >()))
|
||||
>::type operator= (T&& val) noexcept(noexcept(*std::declval< Iterator& >() = std::declval< T&& >()))
|
||||
{
|
||||
*m_iter = static_cast< T&& >(val);
|
||||
return *this;
|
||||
|
Reference in New Issue
Block a user