vectorization interface causes Alberta regression
Originally posted by @felix.gruber in !121 (merged):
@joe: this merge broke dune-grid with Alberta. Somehow the new swap(T& v1, T& v2, bool mask)
prevents std::swap(T& v1, T& v2)
to be found.
The error message I get with g++-5.2.0 is
/home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/elementinfo.hh:391:11: error: no matching function for call to ‘swap(Dune::Alberta::ElementInfo<1>::Instance*&, Dune::Alberta::ElementInfo<1>::Instance*&)’
swap( instance_, other.instance_ );
^
In file included from /home/data/gruber/src/dune-git/dune-common/dune/common/densematrix.hh:19:0,
from /home/data/gruber/src/dune-git/dune-common/dune/common/fmatrix.hh:15,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/agrid.hh:25,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid.hh:5,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/dgfparser.hh:8,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/dgfparser.cc:10:
/home/data/gruber/src/dune-git/dune-common/dune/common/simd.hh:300:8: note: candidate: template<class T> void Dune::swap(T&, T&, bool)
void swap(T &v1, T &v2, bool mask)
^
/home/data/gruber/src/dune-git/dune-common/dune/common/simd.hh:300:8: note: template argument deduction/substitution failed:
In file included from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/meshpointer.hh:15:0,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/coordcache.hh:6,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/agrid.hh:42,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid.hh:5,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/dgfparser.hh:8,
from /home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/dgfparser.cc:10:
/home/data/gruber/src/dune-git/dune-grid/dune/grid/albertagrid/elementinfo.hh:391:11: note: candidate expects 3 arguments, 2 provided
swap( instance_, other.instance_ );
^
and looking at the code in dune/grid/albertagrid/elementinfo.hh:391
template< int dim >
inline ElementInfo< dim >::ElementInfo ( ElementInfo &&other )
: instance_( NULL )
{
using namespace std;
swap( instance_, other.instance_ );
}
I do not understand why std::swap
isn't used, especially since <utility>
gets included at the top of the file so that it's definition should be available for overload resolution.