+2016-10-24 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/stl_vector.h (vector::_M_data_ptr, vector::data):
+ Change return type of non-standard C++98 extension to match C++11.
+
2016-10-22 François Dumont <fdumont@gcc.gnu.org>
* include/bits/c++config (_GLIBCXX_BEGIN_NAMESPACE_ALGO)
* Returns a pointer such that [data(), data() + size()) is a valid
* range. For a non-empty %vector, data() == &front().
*/
-#if __cplusplus >= 201103L
_Tp*
-#else
- pointer
-#endif
data() _GLIBCXX_NOEXCEPT
{ return _M_data_ptr(this->_M_impl._M_start); }
-#if __cplusplus >= 201103L
const _Tp*
-#else
- const_pointer
-#endif
data() const _GLIBCXX_NOEXCEPT
{ return _M_data_ptr(this->_M_impl._M_start); }
}
#endif
-#if __cplusplus >= 201103L
template<typename _Up>
_Up*
- _M_data_ptr(_Up* __ptr) const
+ _M_data_ptr(_Up* __ptr) const _GLIBCXX_NOEXCEPT
{ return __ptr; }
+#if __cplusplus >= 201103L
template<typename _Ptr>
typename std::pointer_traits<_Ptr>::element_type*
_M_data_ptr(_Ptr __ptr) const
{ return empty() ? nullptr : std::__addressof(*__ptr); }
#else
+ template<typename _Up>
+ _Up*
+ _M_data_ptr(_Up* __ptr) _GLIBCXX_NOEXCEPT
+ { return __ptr; }
+
+ template<typename _Ptr>
+ value_type*
+ _M_data_ptr(_Ptr __ptr)
+ { return __ptr.operator->(); }
+
template<typename _Ptr>
- _Ptr
+ const value_type*
_M_data_ptr(_Ptr __ptr) const
- { return __ptr; }
+ { return __ptr.operator->(); }
#endif
};