Skip to content

Commit

Permalink
Mark c_array as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 25, 2025
1 parent f5a3f1b commit 16b6ba8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions include/boost/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ namespace boost {
boost::core::invoke_swap(elems[i],y.elems[i]);
}

// direct access to data (read-only)
// direct access to data
BOOST_CONSTEXPR const T* data() const BOOST_NOEXCEPT { return elems; }
BOOST_CXX14_CONSTEXPR T* data() BOOST_NOEXCEPT { return elems; }

// use array as C array (direct read/write access to data)
// obsolete
BOOST_DEPRECATED( "please use `data()` instead" )
T* c_array() BOOST_NOEXCEPT { return elems; }

// assignment with type conversion
Expand Down Expand Up @@ -263,11 +264,12 @@ namespace boost {
void swap (array<T,0>& /*y*/) {
}

// direct access to data (read-only)
// direct access to data
BOOST_CONSTEXPR const T* data() const BOOST_NOEXCEPT { return 0; }
BOOST_CXX14_CONSTEXPR T* data() BOOST_NOEXCEPT { return 0; }

// use array as C array (direct read/write access to data)
// obsolete
BOOST_DEPRECATED( "please use `data()` instead" )
T* c_array() BOOST_NOEXCEPT { return 0; }

// assignment with type conversion
Expand Down

0 comments on commit 16b6ba8

Please sign in to comment.