summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-09-11 09:00:18 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-09-11 09:00:18 +0200
commitdf6c67d25a85f9f12923f54e05695ad333a0835b (patch)
tree05f5487aadbeb8bba6ad6915bbad619415052df5
parentdc088ee4158029c41e69bd7fab295498accecdfc (diff)
Add copy-constructor for class interface
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/interface.cpp5
-rw-r--r--src/interface.hpp2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/interface.cpp b/src/interface.cpp
index 381ccfe..2795e0c 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -5,6 +5,11 @@ interface::interface(std::string name, std::optional<std::string> addr):
{
}
+interface::interface(const interface& old):
+ name(old.name), addr(old.addr)
+{
+}
+
std::string const&
interface::get_name(void) const
{
diff --git a/src/interface.hpp b/src/interface.hpp
index 840d25d..ce64b3e 100644
--- a/src/interface.hpp
+++ b/src/interface.hpp
@@ -8,6 +8,8 @@ class interface {
public:
interface(std::string name, std::optional<std::string> addr);
+ interface(const interface& old);
+
std::string const& get_name(void) const;
std::optional<std::string> const& get_addr(void) const;