summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
authordennsporcic <denn.sporcic@gmail.com>2019-05-13 18:58:24 +1000
committerBenoit Foucher <benoit@zeroc.com>2019-05-13 10:58:24 +0200
commit2e2910756b5cfa220baab7cb0b482af4738f59a1 (patch)
tree4745f3ecc1ea95cbf15783abc5f9b786a7b88641 /cpp/include
parentFixed typo in comment (diff)
downloadice-2e2910756b5cfa220baab7cb0b482af4738f59a1.tar.bz2
ice-2e2910756b5cfa220baab7cb0b482af4738f59a1.tar.xz
ice-2e2910756b5cfa220baab7cb0b482af4738f59a1.zip
gcc 9 complains that it is creating an implicit copy constructor. (#408)
* gcc 9 complains that it is creating an implicit copy constructor. This is deprecated behaviour since C++11 and gcc 9 treats it as a warning. Adding a copy constructor silences this. Fixes #387
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/IceUtil/Optional.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/Optional.h b/cpp/include/IceUtil/Optional.h
index a4266aeeb6c..ac12789bfd9 100644
--- a/cpp/include/IceUtil/Optional.h
+++ b/cpp/include/IceUtil/Optional.h
@@ -45,6 +45,14 @@ public:
Optional(IceUtilInternal::NoneType) : _isSet(false)
{
}
+
+ /**
+ * Constructs an optional as a copy of the given optional.
+ * @param r The source optional.
+ */
+ Optional(const Optional& r) : _value(r._value), _isSet(r._isSet)
+ {
+ }
/**
* Constructs an optional with the given value.