Skip to content
Snippets Groups Projects
Commit 2747376f authored by René Fritze's avatar René Fritze
Browse files

[common] adds FieldVector variant that's initialized with compile-time constant

parent 882fe5e7
No related branches found
No related tags found
No related merge requests found
...@@ -107,6 +107,21 @@ public: ...@@ -107,6 +107,21 @@ public:
} }
}; // class FieldVector }; // class FieldVector
template <class K, int SIZE, K value>
class ValueInitFieldVector : public Dune::Stuff::Common::FieldVector<K, SIZE>
{
static_assert(SIZE >= 0, "Really?");
typedef Dune::Stuff::Common::FieldVector<K, SIZE> BaseType;
typedef ValueInitFieldVector<K, SIZE, value> ThisType;
public:
ValueInitFieldVector()
: BaseType(value)
{
}
}; // class FieldVector
} // namespace Common } // namespace Common
} // namespace Stuff } // namespace Stuff
......
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