Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jakub.both/dune-common
  • samuel.burbulla/dune-common
  • patrick.jaap/dune-common
  • tobias.leibner/dune-common
  • alexander.mueller/dune-common
  • pipping/dune-common
  • Xinyun.Li/dune-common
  • felix.schindler/dune-common
  • simon.praetorius/dune-common
  • ani.anciaux-sedrakian/dune-common
  • henrik.stolzmann/dune-common
  • matthew.t.collins/dune-common
  • liam.keegan/dune-common
  • felix.mueller/dune-common
  • ansgar/dune-common
  • dominic/dune-common
  • lars.lubkoll/dune-common
  • exadune/dune-common
  • felix.gruber/dune-common
  • govind.sahai/dune-common
  • michael.sghaier/dune-common
  • core/dune-common
  • kilian.weishaupt/dune-common
  • markus.blatt/dune-common
  • joscha.podlesny/dune-common
  • tobias.meyer.andersen/dune-common
  • andreas.thune/dune-common
  • lars.bilke/dune-common
  • daniel.kienle/dune-common
  • lukas.renelt/dune-common
  • smuething/dune-common
  • stephan.hilb/dune-common
  • tkoch/dune-common
  • nils.dreier/dune-common
  • rene.milk/dune-common
  • lasse.hinrichsen/dune-common
  • yunus.sevinchan/dune-common
  • lisa_julia.nebel/dune-common
  • claus-justus.heine/dune-common
  • lorenzo.cerrone/dune-common
  • eduardo.bueno/dune-common
41 results
Show changes
Commits on Source (9)
...@@ -28,7 +28,7 @@ dune-common depends on the following software packages ...@@ -28,7 +28,7 @@ dune-common depends on the following software packages
icc (C/C++) >= 13.0 icc (C/C++) >= 13.0
Clang >= 3.2 Clang >= 3.2
The following software is recommend but optional: The following software is recommended but optional:
- MPI (either OpenMPI, lam, or mpich suffice) - MPI (either OpenMPI, lam, or mpich suffice)
......
...@@ -284,18 +284,18 @@ namespace Dune { ...@@ -284,18 +284,18 @@ namespace Dune {
//! random access //! random access
value_type & operator[] (size_type i) value_type & operator[] (size_type i)
{ {
return asImp().vec_access(i); return asImp()[i];
} }
const value_type & operator[] (size_type i) const const value_type & operator[] (size_type i) const
{ {
return asImp().vec_access(i); return asImp()[i];
} }
//! size method //! size method
size_type size() const size_type size() const
{ {
return asImp().vec_size(); return asImp().size();
} }
//! Iterator class for sequential access //! Iterator class for sequential access
......
...@@ -137,9 +137,9 @@ namespace Dune { ...@@ -137,9 +137,9 @@ namespace Dune {
} }
//==== make this thing a vector //==== make this thing a vector
size_type vec_size() const { return _data.size(); } size_type size() const { return _data.size(); }
K & vec_access(size_type i) { return _data[i]; } K & operator[](size_type i) { return _data[i]; }
const K & vec_access(size_type i) const { return _data[i]; } const K & operator[](size_type i) const { return _data[i]; }
}; };
/** \brief Read a DynamicVector from an input stream /** \brief Read a DynamicVector from an input stream
......
...@@ -158,12 +158,10 @@ namespace Dune { ...@@ -158,12 +158,10 @@ namespace Dune {
} }
using Base::operator=; using Base::operator=;
DUNE_CONSTEXPR size_type size () const { return vec_size(); }
// make this thing a vector // make this thing a vector
DUNE_CONSTEXPR size_type vec_size () const { return SIZE; } DUNE_CONSTEXPR size_type size () const { return SIZE; }
K & vec_access(size_type i) { return _data[i]; } K & operator[](size_type i) { return _data[i]; }
const K & vec_access(size_type i) const { return _data[i]; } const K & operator[](size_type i) const { return _data[i]; }
private: private:
void fill(const K& t) void fill(const K& t)
{ {
...@@ -266,17 +264,15 @@ namespace Dune { ...@@ -266,17 +264,15 @@ namespace Dune {
return *this; return *this;
} }
DUNE_CONSTEXPR size_type size () const { return vec_size(); }
//===== forward methods to container //===== forward methods to container
DUNE_CONSTEXPR size_type vec_size () const { return 1; } DUNE_CONSTEXPR size_type size () const { return 1; }
K & vec_access(size_type i) K & operator[](size_type i)
{ {
DUNE_UNUSED_PARAMETER(i); DUNE_UNUSED_PARAMETER(i);
assert(i == 0); assert(i == 0);
return _data; return _data;
} }
const K & vec_access(size_type i) const const K & operator[](size_type i) const
{ {
DUNE_UNUSED_PARAMETER(i); DUNE_UNUSED_PARAMETER(i);
assert(i == 0); assert(i == 0);
......
...@@ -531,6 +531,38 @@ namespace Dune ...@@ -531,6 +531,38 @@ namespace Dune
#endif // defined(DOXYGEN) or HAVE_IS_INDEXABLE_SUPPORT #endif // defined(DOXYGEN) or HAVE_IS_INDEXABLE_SUPPORT
namespace detail
{
///
/**
* @internal
* @brief Helper to make void_t work with gcc versions prior to gcc 5.0.
*
* This was not a compiler bug, but an accidental omission in the C++11 standard (see N3911, CWG issue 1558).
* It is not clearly specified what happens
* with unused template arguments in template aliases. The developers of GCC decided to ignore them, thus making void_t equivalent to void.
* With gcc 5.0 this was changed and the voider-hack is no longer needed.
*/
template <class...>
struct voider
{
using type = void;
};
}
template <class> struct FieldTraits;
//! Is void for all valid input types (see N3911). The workhorse for C++11 SFINAE-techniques.
template <class... Types>
using void_t = typename detail::voider<Types...>::type;
//! Convenient access to FieldTraits<Type>::field_type.
template <class Type>
using field_t = typename FieldTraits<Type>::field_type;
//! Convenient access to FieldTraits<Type>::real_type.
template <class Type>
using real_t = typename FieldTraits<Type>::real_type;
/** @} */ /** @} */
} }
......