Skip to content
Snippets Groups Projects
Commit 0f610dd4 authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Make Dune::Solvers::TupleVector an alias for Dune::TupleVector

This brings us std::tuple_element for Dune::Solvers::TupleVector.
parent 5fc88b19
No related branches found
No related tags found
1 merge request!77Deprecate the file tuplevector.hh
......@@ -3,10 +3,9 @@
#ifndef DUNE_SOLVERS_COMMON_TUPLEVECTOR_HH
#define DUNE_SOLVERS_COMMON_TUPLEVECTOR_HH
#include <tuple>
#warning This file is deprecated! Use tuplevector.hh from the dune-common module instead!
#include <dune/common/indices.hh>
#include <dune/common/tuplevector.hh>
namespace Dune
{
......@@ -17,38 +16,7 @@ namespace Solvers
* \brief A std::tuple that allows access to its element via operator[]
*/
template<class... T>
class TupleVector : public std::tuple<T...>
{
using Base = std::tuple<T...>;
public:
// inherit all constructors from std::tuple
using Base::Base;
/** \brief Const access to the tuple elements */
template<std::size_t i>
auto operator[](const Dune::index_constant<i>&) const
->decltype(std::get<i>(*this))
{
return std::get<i>(*this);
}
/** \brief Non-const access to the tuple elements */
template<std::size_t i>
auto operator[](const Dune::index_constant<i>&)
->decltype(std::get<i>(*this))
{
return std::get<i>(*this);
}
/** \brief Number of elements of the tuple */
static constexpr std::size_t size()
{
return std::tuple_size<Base>::value;
}
};
using TupleVector = Dune::TupleVector<T...>;
} // namespace Functions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment