@@ -689,7 +689,7 @@ class array : public buffer {
689
689
* care: the array must not be destroyed or reshaped for the duration of the returned object,
690
690
* and the caller must take care not to access invalid dimensions or dimension indices.
691
691
*/
692
- template <typename T, ssize_t Dims = -1 > detail::unchecked_mutable_reference<T, Dims> mutable_unchecked () {
692
+ template <typename T, ssize_t Dims = -1 > detail::unchecked_mutable_reference<T, Dims> mutable_unchecked () & {
693
693
if (Dims >= 0 && ndim () != Dims)
694
694
throw std::domain_error (" array has incorrect number of dimensions: " + std::to_string (ndim ()) +
695
695
" ; expected " + std::to_string (Dims));
@@ -703,7 +703,7 @@ class array : public buffer {
703
703
* reshaped for the duration of the returned object, and the caller must take care not to access
704
704
* invalid dimensions or dimension indices.
705
705
*/
706
- template <typename T, ssize_t Dims = -1 > detail::unchecked_reference<T, Dims> unchecked () const {
706
+ template <typename T, ssize_t Dims = -1 > detail::unchecked_reference<T, Dims> unchecked () const & {
707
707
if (Dims >= 0 && ndim () != Dims)
708
708
throw std::domain_error (" array has incorrect number of dimensions: " + std::to_string (ndim ()) +
709
709
" ; expected " + std::to_string (Dims));
@@ -876,7 +876,7 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public
876
876
* care: the array must not be destroyed or reshaped for the duration of the returned object,
877
877
* and the caller must take care not to access invalid dimensions or dimension indices.
878
878
*/
879
- template <ssize_t Dims = -1 > detail::unchecked_mutable_reference<T, Dims> mutable_unchecked () {
879
+ template <ssize_t Dims = -1 > detail::unchecked_mutable_reference<T, Dims> mutable_unchecked () & {
880
880
return array::mutable_unchecked<T, Dims>();
881
881
}
882
882
@@ -887,7 +887,7 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public
887
887
* for the duration of the returned object, and the caller must take care not to access invalid
888
888
* dimensions or dimension indices.
889
889
*/
890
- template <ssize_t Dims = -1 > detail::unchecked_reference<T, Dims> unchecked () const {
890
+ template <ssize_t Dims = -1 > detail::unchecked_reference<T, Dims> unchecked () const & {
891
891
return array::unchecked<T, Dims>();
892
892
}
893
893
0 commit comments