FilteredIterator<BaseIterator>::
operator = (const FilteredIterator &fi)
{
+ // Using equivalent code to the one for 'operator=(const BaseIterator &bi)'
+ // below, some compiler would not cast fi to the base class of type
+ // BaseIterator but try to go through constructing a new Accessor from fi
+ // which fails. Hence, we just use an explicit upcast and call the above-
+ // mentioned method.
const BaseIterator &bi = fi;
return operator = (bi);
}
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+/*
+ * Test that copying a FilteredIterator works
+ */
+
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/filtered_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include "../tests.h"
+
+template<int dim>
+void
+test()
+{
+ Triangulation<dim> triangulation;
+ DoFHandler<dim> dof_handler(triangulation);
+ GridGenerator::hyper_cube(triangulation);
+
+ FilteredIterator<typename DoFHandler<dim>::level_cell_iterator> begin
+ (IteratorFilters::LocallyOwnedLevelCell(), dof_handler.begin());
+ FilteredIterator<typename DoFHandler<dim>::level_cell_iterator> end
+ (IteratorFilters::LocallyOwnedLevelCell(), dof_handler.end());
+ end = begin;
+
+ deallog << "OK" << std::endl;
+}
+
+int main()
+{
+ initlog();
+ test<2>();
+
+ return 0;
+}