This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RFC: change return type of non-standard vector::data() extension in C++03 mode
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 22 Aug 2016 17:29:04 +0100
- Subject: RFC: change return type of non-standard vector::data() extension in C++03 mode
- Authentication-results: sourceware.org; auth=none
Our std::vector defines data() in C++98/C++03 mode, as a non-standard
extension:
#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); }
We should either be using abi_tag to give the functions different
symbols, or just change the pre-C++11 signatures to match the standard
signatures.
Any objections to changing the return type?