mirror of
https://github.com/TartanLlama/optional.git
synced 2025-06-25 00:51:37 +02:00
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/
|
||||
.idea
|
||||
cmake-*
|
@ -452,7 +452,8 @@ struct optional_copy_base<T, false> : optional_operations_base<T> {
|
||||
using optional_operations_base<T>::optional_operations_base;
|
||||
|
||||
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()) {
|
||||
this->construct(rhs.get());
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user