Commit 278e4717 authored by Simon Praetorius's avatar Simon Praetorius

rebase to master

parent b6efcad8
......@@ -34,7 +34,6 @@ namespace Dune {
class ContainerFactory
{
public:
/**
* \brief Create ContainerFactory
*
......@@ -92,24 +91,22 @@ namespace Dune {
{
auto head = path[Dune::Indices::_0];
auto tailPath = Dune::unpackIntegerSequence([&](auto... i){
return treePath(path[i+1]...);
}, std::make_index_sequence<sizeof...(T)-1>());
return treePath(path[i+1]...);
}, std::make_index_sequence<sizeof...(T)-1>());
return accessByTreePath(container[head], tailPath);
}
public:
//! Default constructor for the tree-container
TreeContainerVectorBackend() :
container_()
{}
//! Move the passed container into the internal storage
TreeContainerVectorBackend(Container&& container) :
container_(std::move(container))
{}
TreeContainerVectorBackend(TreeContainerVectorBackend&& other) :
container_(std::move(other.container_))
{}
template<class... T>
decltype(auto) operator[](const HybridTreePath<T...>& path) const
{
......
......@@ -47,6 +47,18 @@ Dune::TestSuite checkTreeContainer(const Tree& tree, const Value& value)
// default construct a container
Dune::TypeTree::UniformTreeContainer<Value,Tree> container2{};
// copy construct the container
auto container3 = container;
// copy-assign the container
container3 = container;
// move-construct the container
auto container4 = std::move(container2);
// move-assign the container
container4 = std::move(container3);
Dune::TypeTree::forEachLeafNode(tree, [&] (auto&& node, auto treePath) {
test.check(notThrown([&]() {
container[treePath] = value;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment