mirror of
https://github.com/boostorg/ublas.git
synced 2026-02-21 15:32:12 +00:00
Merge pull request #5 from awulkiew/fix/constexpr
Fix the use of constexpr in msvc-12.0
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#ifndef _BOOST_UBLAS_MATRIX_
|
||||
#define _BOOST_UBLAS_MATRIX_
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/matrix_expression.hpp>
|
||||
#include <boost/numeric/ublas/detail/matrix_assign.hpp>
|
||||
@@ -1194,7 +1195,7 @@ namespace boost { namespace numeric {
|
||||
* You can also use the free size<>() function in operation/size.hpp as size<1>(m) where m is a fixed_matrix
|
||||
*/
|
||||
BOOST_UBLAS_INLINE
|
||||
constexpr size_type size1 () const {
|
||||
BOOST_CONSTEXPR size_type size1 () const {
|
||||
return M;
|
||||
}
|
||||
|
||||
@@ -1202,7 +1203,7 @@ namespace boost { namespace numeric {
|
||||
* You can also use the free size<>() function in operation/size.hpp as size<2>(m) where m is a fixed_matrix
|
||||
*/
|
||||
BOOST_UBLAS_INLINE
|
||||
constexpr size_type size2 () const {
|
||||
BOOST_CONSTEXPR size_type size2 () const {
|
||||
return N;
|
||||
}
|
||||
|
||||
@@ -3210,7 +3211,7 @@ namespace boost { namespace numeric {
|
||||
|
||||
// Resizing
|
||||
BOOST_UBLAS_INLINE
|
||||
void resize (size_type size, bool preserve = true) {
|
||||
void resize (size_type size, bool /*preserve*/ = true) {
|
||||
size1_ = size;
|
||||
size2_ = size;
|
||||
}
|
||||
@@ -3597,7 +3598,7 @@ namespace boost { namespace numeric {
|
||||
|
||||
// Resizing
|
||||
BOOST_UBLAS_INLINE
|
||||
void resize (size_type size, bool preserve = true) {
|
||||
void resize (size_type size, bool /*preserve*/ = true) {
|
||||
size1_ = size;
|
||||
size2_ = size;
|
||||
size_common_ = ((std::min)(size1_, size2_));
|
||||
@@ -4692,7 +4693,7 @@ namespace boost { namespace numeric {
|
||||
|
||||
// Element lookup
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator1 find1 (int rank, size_type i, size_type j) const {
|
||||
const_iterator1 find1 (int /*rank*/, size_type i, size_type j) const {
|
||||
#ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR
|
||||
return const_iterator1 (*this, i, j);
|
||||
#else
|
||||
@@ -4700,7 +4701,7 @@ namespace boost { namespace numeric {
|
||||
#endif
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
iterator1 find1 (int rank, size_type i, size_type j) {
|
||||
iterator1 find1 (int /*rank*/, size_type i, size_type j) {
|
||||
#ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR
|
||||
return iterator1 (*this, i, j);
|
||||
#else
|
||||
@@ -4708,7 +4709,7 @@ namespace boost { namespace numeric {
|
||||
#endif
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator2 find2 (int rank, size_type i, size_type j) const {
|
||||
const_iterator2 find2 (int /*rank*/, size_type i, size_type j) const {
|
||||
#ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR
|
||||
return const_iterator2 (*this, i, j);
|
||||
#else
|
||||
@@ -4716,7 +4717,7 @@ namespace boost { namespace numeric {
|
||||
#endif
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
iterator2 find2 (int rank, size_type i, size_type j) {
|
||||
iterator2 find2 (int /*rank*/, size_type i, size_type j) {
|
||||
#ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR
|
||||
return iterator2 (*this, i, j);
|
||||
#else
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
// Serialization
|
||||
template<class Archive>
|
||||
void serialize(Archive & ar, const unsigned int version)
|
||||
void serialize(Archive & ar, const unsigned int /*version*/)
|
||||
{
|
||||
serialization::collection_size_type s(size_);
|
||||
ar & serialization::make_nvp("size",s);
|
||||
@@ -451,7 +451,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
friend class boost::serialization::access;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & ar, const unsigned int version)
|
||||
void serialize(Archive & ar, const unsigned int /*version*/)
|
||||
{
|
||||
serialization::collection_size_type s(size_);
|
||||
ar & serialization::make_nvp("size", s);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifndef _BOOST_UBLAS_VECTOR_
|
||||
#define _BOOST_UBLAS_VECTOR_
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/numeric/ublas/storage.hpp>
|
||||
#include <boost/numeric/ublas/vector_expression.hpp>
|
||||
#include <boost/numeric/ublas/detail/vector_assign.hpp>
|
||||
@@ -88,7 +89,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
/// \param data container of type \c A
|
||||
/// \todo remove this definition because \c size is not used
|
||||
BOOST_UBLAS_INLINE
|
||||
vector (size_type size, const array_type &data):
|
||||
vector (size_type /*size*/, const array_type &data):
|
||||
vector_container<self_type> (),
|
||||
data_ (data) {}
|
||||
|
||||
@@ -907,7 +908,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
/// \brief Return the size of the vector
|
||||
BOOST_UBLAS_INLINE
|
||||
constexpr size_type size () const{ // should have a const after C++14
|
||||
BOOST_CONSTEXPR size_type size () const{ // should have a const after C++14
|
||||
return data_.size ();
|
||||
}
|
||||
|
||||
@@ -1675,7 +1676,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
// Element support
|
||||
BOOST_UBLAS_INLINE
|
||||
const_pointer find_element (size_type i) const {
|
||||
const_pointer find_element (size_type /*i*/) const {
|
||||
return & zero_;
|
||||
}
|
||||
|
||||
@@ -2384,7 +2385,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
// Resizing
|
||||
BOOST_UBLAS_INLINE
|
||||
void resize (size_type size, bool preserve = true) {
|
||||
void resize (size_type size, bool /*preserve*/ = true) {
|
||||
if (size > N)
|
||||
bad_size ().raise ();
|
||||
size_ = size;
|
||||
|
||||
@@ -1303,8 +1303,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
// Closure comparison
|
||||
BOOST_UBLAS_INLINE
|
||||
bool same_closure (const vector_indirect &vr) const {
|
||||
return true;
|
||||
bool same_closure (const vector_indirect &/*vr*/) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Comparison
|
||||
|
||||
Reference in New Issue
Block a user