ENH: COMP: handle compiler ambiguities for tmp vs movable references

- seen with gcc-4.9.4, but not with gcc-7

- provide additional constructors from tmp for DimensionedField, FieldField
This commit is contained in:
Mark Olesen
2018-10-12 18:58:28 +02:00
parent 8eddcc072a
commit e5c3e7de75
8 changed files with 273 additions and 141 deletions

View File

@ -304,6 +304,52 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(
const IOobject& io,
const Mesh& mesh,
const dimensionSet& ds,
const Field<Type>& iField,
const word& patchFieldType
)
:
Internal(io, mesh, ds, iField),
timeIndex_(this->time().timeIndex()),
field0Ptr_(nullptr),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, patchFieldType)
{
DebugInFunction
<< "Copy construct from internal field" << nl << this->info() << endl;
readIfPresent();
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(
const IOobject& io,
const Mesh& mesh,
const dimensionSet& ds,
Field<Type>&& iField,
const word& patchFieldType
)
:
Internal(io, mesh, ds, std::move(iField)),
timeIndex_(this->time().timeIndex()),
field0Ptr_(nullptr),
fieldPrevIterPtr_(nullptr),
boundaryField_(mesh.boundary(), *this, patchFieldType)
{
DebugInFunction
<< "Move construct from internal field" << nl << this->info() << endl;
readIfPresent();
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(