forked from TartanLlama/optional
Merge pull request #45 from ElDesalmado/master
Added explicit default initialization in copy constructor
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
\#*
|
\#*
|
||||||
.\#*
|
.\#*
|
||||||
/build/
|
/build/
|
||||||
|
.idea
|
||||||
|
cmake-*
|
@ -452,7 +452,8 @@ struct optional_copy_base<T, false> : optional_operations_base<T> {
|
|||||||
using optional_operations_base<T>::optional_operations_base;
|
using optional_operations_base<T>::optional_operations_base;
|
||||||
|
|
||||||
optional_copy_base() = default;
|
optional_copy_base() = default;
|
||||||
optional_copy_base(const optional_copy_base &rhs) {
|
optional_copy_base(const optional_copy_base &rhs)
|
||||||
|
: optional_operations_base<T>() {
|
||||||
if (rhs.has_value()) {
|
if (rhs.has_value()) {
|
||||||
this->construct(rhs.get());
|
this->construct(rhs.get());
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user