2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

Remove const from rvalue returns (#42).

I'd originally thought this was a useful way to prevent no-op
assignments to rvalues, but compilers now check for that
without using const, and it was probably only non-standard
compiler behavior that ever made it useful.
This commit is contained in:
Jim Bosch
2015-09-09 22:38:50 -04:00
parent a0e849ed91
commit 61a399e80a
4 changed files with 11 additions and 11 deletions

View File

@@ -87,10 +87,10 @@ public:
ndarray copy() const;
/// @brief Return the size of the nth dimension.
Py_intptr_t const shape(int n) const { return get_shape()[n]; }
Py_intptr_t shape(int n) const { return get_shape()[n]; }
/// @brief Return the stride of the nth dimension.
Py_intptr_t const strides(int n) const { return get_strides()[n]; }
Py_intptr_t strides(int n) const { return get_strides()[n]; }
/**
* @brief Return the array's raw data pointer.
@@ -116,10 +116,10 @@ public:
Py_intptr_t const * get_strides() const { return get_struct()->strides; }
/// @brief Return the number of array dimensions.
int const get_nd() const { return get_struct()->nd; }
int get_nd() const { return get_struct()->nd; }
/// @brief Return the array flags.
bitflag const get_flags() const;
bitflag get_flags() const;
/// @brief Reverse the dimensions of the array.
ndarray transpose() const;

View File

@@ -52,13 +52,13 @@ public:
char * get_data(int n) const;
/// @brief Return the number of dimensions of the broadcasted array expression.
int const get_nd() const;
int get_nd() const;
/// @brief Return the shape of the broadcasted array expression as an array of integers.
Py_intptr_t const * get_shape() const;
/// @brief Return the shape of the broadcasted array expression in the nth dimension.
Py_intptr_t const shape(int n) const;
Py_intptr_t shape(int n) const;
};

View File

@@ -22,7 +22,7 @@ namespace numpy
namespace detail
{
ndarray::bitflag numpy_to_bitflag(int const f)
ndarray::bitflag numpy_to_bitflag(int const f)
{
ndarray::bitflag r = ndarray::NONE;
if (f & NPY_C_CONTIGUOUS) r = (r | ndarray::C_CONTIGUOUS);
@@ -32,7 +32,7 @@ ndarray::bitflag numpy_to_bitflag(int const f)
return r;
}
int const bitflag_to_numpy(ndarray::bitflag f)
int bitflag_to_numpy(ndarray::bitflag f)
{
int r = 0;
if (f & ndarray::C_CONTIGUOUS) r |= NPY_C_CONTIGUOUS;
@@ -184,7 +184,7 @@ void ndarray::set_base(object const & base)
}
}
ndarray::bitflag const ndarray::get_flags() const
ndarray::bitflag ndarray::get_flags() const
{
return numpy::detail::numpy_to_bitflag(get_struct()->flags);
}

View File

@@ -50,7 +50,7 @@ char * multi_iter::get_data(int i) const
return reinterpret_cast<char*>(PyArray_MultiIter_DATA(ptr(), i));
}
int const multi_iter::get_nd() const
int multi_iter::get_nd() const
{
return reinterpret_cast<PyArrayMultiIterObject*>(ptr())->nd;
}
@@ -60,7 +60,7 @@ Py_intptr_t const * multi_iter::get_shape() const
return reinterpret_cast<PyArrayMultiIterObject*>(ptr())->dimensions;
}
Py_intptr_t const multi_iter::shape(int n) const
Py_intptr_t multi_iter::shape(int n) const
{
return reinterpret_cast<PyArrayMultiIterObject*>(ptr())->dimensions[n];
}