Re[6]: MSVC2015, странные ошибки %)
От: niXman Ниоткуда https://github.com/niXman
Дата: 16.02.16 14:14
Оценка:
и вот такой странный пример:

1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1214): warning C4346: 'std::forward_list<_Ty,_Alloc>::std::forward_list<_Ty,_Alloc>::_Alty::is_always_equal::value': dependent name is not a type
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1214): note: prefix with 'typename' to indicate a type
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1214): error C2061: syntax error: identifier 'value'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1215): error C2091: function returns function


а вот код:
    void swap(_Myt& _Right)
        _NOEXCEPT_OP(_Alty::is_always_equal::value) // <<<<<<<<<<<<<<<<<<<< 1214
        {    // exchange contents with _Right // <<<<<<<<<<<<<<<<<<<< 1215
        if (this == &_Right)
            ;    // same object, do nothing
        else if (this->_Getal() == _Right._Getal())
            {    // same allocator, swap control information
            this->_Swap_all(_Right);
            _Swap_adl(this->_Myhead(), _Right._Myhead());
            }

        else if (_Alty::propagate_on_container_swap::value)
            {    // swap allocators and control information
            this->_Swap_alloc(_Right);
            _Swap_adl(this->_Myhead(), _Right._Myhead());
            }
        else
            {    // containers are incompatible
 #if _ITERATOR_DEBUG_LEVEL == 2
            _DEBUG_ERROR("forward_list containers incompatible for swap");

 #else /* ITERATOR_DEBUG_LEVEL == 2 */
            _XSTD terminate();
 #endif /* ITERATOR_DEBUG_LEVEL == 2 */
            }

        }



и вот так:

1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1564): error C2065: '_Left': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1564): error C2065: '_Right': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\forward_list(1564): error C2206: 'swap': typedef cannot be used for function definition

template<class _Ty,
    class _Alloc> inline
    void swap(forward_list<_Ty, _Alloc>& _Left,
        forward_list<_Ty, _Alloc>& _Right)
        _NOEXCEPT_OP(_NOEXCEPT_OP(_Left.swap(_Right))) // <<<<<<<<<<<<<<<<<<<< 1564
    {    // swap _Left and _Right lists
    _Left.swap(_Right);
    }
пачка бумаги А4 стОит 2000 р, в ней 500 листов. получается, лист обычной бумаги стОит дороже имперского рубля =)
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.