forked from boostorg/array
Mark std::get
illegal overloads as deprecated
This commit is contained in:
@ -416,12 +416,14 @@ namespace boost {
|
|||||||
// If we don't have std::array, I'm assuming that we don't have std::get
|
// If we don't have std::array, I'm assuming that we don't have std::get
|
||||||
namespace std {
|
namespace std {
|
||||||
template <size_t Idx, typename T, size_t N>
|
template <size_t Idx, typename T, size_t N>
|
||||||
|
BOOST_DEPRECATED( "please use `boost::get` instead" )
|
||||||
T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
||||||
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(boost::array &) index out of range" );
|
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(boost::array &) index out of range" );
|
||||||
return arr[Idx];
|
return arr[Idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t Idx, typename T, size_t N>
|
template <size_t Idx, typename T, size_t N>
|
||||||
|
BOOST_DEPRECATED( "please use `boost::get` instead" )
|
||||||
const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
||||||
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(const boost::array &) index out of range" );
|
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(const boost::array &) index out of range" );
|
||||||
return arr[Idx];
|
return arr[Idx];
|
||||||
|
Reference in New Issue
Block a user