Commit 8b6042b6 authored by Martin Heistermann's avatar Martin Heistermann

Properties: pass default value by reference (makes cppcheck happy and possibly avoids a copy

parent f604e8f2
Pipeline #10524 canceled with stage
in 3 minutes and 54 seconds
...@@ -85,11 +85,11 @@ template<typename T, typename Entity> ...@@ -85,11 +85,11 @@ template<typename T, typename Entity>
class PropertyTT : public PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity> { class PropertyTT : public PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity> {
public: public:
template<typename MeshT> template<typename MeshT>
PropertyTT(MeshT *mesh, const std::string& _name, const T _def = T()) PropertyTT(MeshT *mesh, const std::string& _name, const T &_def = T())
: PropertyTT(std::move(mesh->template request_property<T, Entity>(_name, _def))) : PropertyTT(std::move(mesh->template request_property<T, Entity>(_name, _def)))
{} {}
using PropertyHandleT = OpenVolumeMesh::PropHandleT<Entity>; using PropertyHandleT = OpenVolumeMesh::PropHandleT<Entity>;
PropertyTT(const std::string& _name, const std::string& _internal_type_name, ResourceManager& _resMan, PropertyHandleT _handle, const T _def = T()); PropertyTT(const std::string& _name, const std::string& _internal_type_name, ResourceManager& _resMan, PropertyHandleT _handle, const T &_def = T());
~PropertyTT() override = default; ~PropertyTT() override = default;
BaseProperty* clone(ResourceManager &_resMan, OpenVolumeMeshHandle _handle) const override; BaseProperty* clone(ResourceManager &_resMan, OpenVolumeMeshHandle _handle) const override;
const std::string entityType() const override { return entityTypeName<Entity>(); } const std::string entityType() const override { return entityTypeName<Entity>(); }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
namespace OpenVolumeMesh { namespace OpenVolumeMesh {
template<typename T, typename Entity> template<typename T, typename Entity>
PropertyTT<T,Entity>::PropertyTT(const std::string& _name, const std::string& _internal_type_name, ResourceManager& _resMan, PropertyHandleT _handle, const T _def) : PropertyTT<T,Entity>::PropertyTT(const std::string& _name, const std::string& _internal_type_name, ResourceManager& _resMan, PropertyHandleT _handle, const T &_def) :
PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity>(new OpenVolumeMeshPropertyT<T>(_name, _internal_type_name, _def), _resMan, _handle) { PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity>(new OpenVolumeMeshPropertyT<T>(_name, _internal_type_name, _def), _resMan, _handle) {
} }
......
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