From 44a6125bec37f205d73b10a70af82e284c04e8be Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 31 Jan 2018 15:38:16 +0100 Subject: [PATCH] Format const correctness --- src/H5Format.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/H5Format.hpp b/src/H5Format.hpp index b9c5288..8285a06 100644 --- a/src/H5Format.hpp +++ b/src/H5Format.hpp @@ -32,7 +32,7 @@ enum DATA_LOCATION { struct h5_base { - h5_base(std::string name, NODE_TYPE node_type) : name(name), node_type(node_type){}; + h5_base(const std::string& name, NODE_TYPE node_type) : name(name), node_type(node_type){}; virtual ~h5_base(){}; std::string name; NODE_TYPE node_type; @@ -45,23 +45,23 @@ struct h5_data_base{ }; struct h5_parent: public h5_base{ - h5_parent(std::string name, NODE_TYPE node_type, std::list items) : h5_base(name, node_type), items(items) {}; + h5_parent(const std::string& name, NODE_TYPE node_type, const std::list& items) : h5_base(name, node_type), items(items) {}; std::list items; }; struct h5_group : public h5_parent { - h5_group(std::string name, std::list items) : h5_parent(name, GROUP, items) {}; + h5_group(const std::string& name, const std::list& items) : h5_parent(name, GROUP, items) {}; }; struct h5_dataset : public h5_parent, public h5_data_base{ - h5_dataset(std::string name, std::string value, DATA_TYPE data_type, std::list items={}) + h5_dataset(const std::string& name, const std::string& value, DATA_TYPE data_type, const std::list& items={}) : h5_parent(name, DATASET, items), h5_data_base(data_type, REFERENCE), value(value) {}; std::string value; }; struct h5_attr : public h5_base, public h5_data_base { - h5_attr(std::string name, h5_value value, DATA_TYPE data_types, DATA_LOCATION data_location=IMMEDIATE) + h5_attr(const std::string& name, const h5_value& value, DATA_TYPE data_types, DATA_LOCATION data_location=IMMEDIATE) : h5_base(name, ATTRIBUTE), h5_data_base(data_types, data_location), value(value){}; h5_value value; };