Skip to content
Snippets Groups Projects
Commit c11caec8 authored by Marco Agnese's avatar Marco Agnese
Browse files

use constexpr instead of DUNE_CONSTEXPR

parent f72f8a51
No related branches found
No related tags found
1 merge request!26Use constexpr instead of DUNE_CONSTEXPR
......@@ -244,7 +244,7 @@ namespace Dune {
protected:
// construction allowed to derived classes only
DUNE_CONSTEXPR DenseVector () {}
constexpr DenseVector () {}
public:
//===== type definitions and constants
......
......@@ -13,7 +13,6 @@
#include <dune/common/fvector.hh>
#include <dune/common/densematrix.hh>
#include <dune/common/precision.hh>
#include <dune/common/std/constexpr.hh>
namespace Dune
{
......@@ -170,8 +169,8 @@ namespace Dune
}
// make this thing a matrix
DUNE_CONSTEXPR size_type mat_rows() const { return ROWS; }
DUNE_CONSTEXPR size_type mat_cols() const { return COLS; }
constexpr size_type mat_rows() const { return ROWS; }
constexpr size_type mat_cols() const { return COLS; }
row_reference mat_access ( size_type i )
{
......@@ -273,8 +272,8 @@ namespace Dune
}
// make this thing a matrix
DUNE_CONSTEXPR size_type mat_rows() const { return 1; }
DUNE_CONSTEXPR size_type mat_cols() const { return 1; }
constexpr size_type mat_rows() const { return 1; }
constexpr size_type mat_cols() const { return 1; }
row_reference mat_access ( size_type i )
{
......
......@@ -12,8 +12,6 @@
#include <initializer_list>
#include <algorithm>
#include <dune/common/std/constexpr.hh>
#include "typetraits.hh"
#include "exceptions.hh"
#include "array.hh"
......@@ -105,7 +103,7 @@ namespace Dune {
typedef typename Base::value_type value_type;
//! Constructor making default-initialized vector
DUNE_CONSTEXPR FieldVector()
constexpr FieldVector()
: _data{}
{}
......@@ -159,7 +157,7 @@ namespace Dune {
using Base::operator=;
// make this thing a vector
DUNE_CONSTEXPR size_type size () const { return SIZE; }
constexpr size_type size () const { return SIZE; }
K & operator[](size_type i) { return _data[i]; }
const K & operator[](size_type i) const { return _data[i]; }
private:
......@@ -222,7 +220,7 @@ namespace Dune {
//===== construction
/** \brief Default constructor */
DUNE_CONSTEXPR FieldVector ()
constexpr FieldVector ()
: _data()
{}
......@@ -265,7 +263,7 @@ namespace Dune {
}
//===== forward methods to container
DUNE_CONSTEXPR size_type size () const { return 1; }
constexpr size_type size () const { return 1; }
K & operator[](size_type i)
{
DUNE_UNUSED_PARAMETER(i);
......
......@@ -40,9 +40,9 @@ namespace Dune
typedef std::size_t size_type;
/** \brief return number of rows */
DUNE_CONSTEXPR size_type rows () const { return N; }
constexpr size_type rows () const { return N; }
/** \brief return number of columns */
DUNE_CONSTEXPR size_type cols () const { return N; }
constexpr size_type cols () const { return N; }
/** \copydoc Dune::DenseMatrix::mv */
template< class X, class Y >
......
......@@ -182,13 +182,13 @@ namespace Dune
}
//! Returns current capacity (allocated memory) of the vector.
static DUNE_CONSTEXPR size_type capacity()
static constexpr size_type capacity()
{
return n;
}
//! Returns the maximum length of the vector.
static DUNE_CONSTEXPR size_type max_size()
static constexpr size_type max_size()
{
return n;
}
......
......@@ -6,7 +6,6 @@
#include <type_traits>
#include <utility>
#include <dune/common/std/constexpr.hh>
#include <dune/common/std/noexcept.hh>
namespace Dune
......@@ -44,7 +43,7 @@ namespace Dune
typedef T value_type;
/** \brief return number of elements in sequence */
static DUNE_CONSTEXPR std::size_t size () { return sizeof...( Ints ); }
static constexpr std::size_t size () { return sizeof...( Ints ); }
};
......@@ -126,7 +125,7 @@ namespace Dune
* \tparam N requested size of index sequence
*/
template< std::size_t N >
static DUNE_CONSTEXPR inline typename make_index_sequence_impl< N >::type make_index_sequence ()
static constexpr inline typename make_index_sequence_impl< N >::type make_index_sequence ()
{
return typename make_index_sequence_impl< N >::type();
}
......@@ -145,7 +144,7 @@ namespace Dune
* \tparam N requested size of integer sequence
*/
template< class T, T N >
static DUNE_CONSTEXPR inline typename make_index_sequence_impl< N >::type::template rebind< T >::type
static constexpr inline typename make_index_sequence_impl< N >::type::template rebind< T >::type
make_integer_sequence ()
{
return typename make_index_sequence_impl< N >::type::template rebind< T >::type();
......@@ -164,7 +163,7 @@ namespace Dune
* \tparam ...T a type parameter pack
*/
template< class... T >
static DUNE_CONSTEXPR inline typename make_index_sequence_impl< sizeof...( T ) >::type
static constexpr inline typename make_index_sequence_impl< sizeof...( T ) >::type
index_sequence_for ()
{
return typename make_index_sequence_impl< sizeof...( T ) >::type();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment