Commit e5223391 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'cleanup/deprecate-optional' into 'master'

Cleanup/deprecate optional

See merge request !1881
parents ea670a3e 02a80bbf
......@@ -26,6 +26,7 @@
#ifndef DUMUX_COMMON_OPTIONAL_HH
#define DUMUX_COMMON_OPTIONAL_HH
#warning "This header is deprecated and will be removed after release 3.2"
#include <utility>
#include <dune/common/typeutilities.hh>
......@@ -38,7 +39,7 @@ namespace Dumux {
* \tparam T Type of wrapped objects
*/
template<class T>
class Optional
class [[deprecated("Optional is deprecated (removed after 3.2); use std::optional")]] Optional
{
public:
......
......@@ -24,9 +24,10 @@
#ifndef DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
#define DUMUX_DISCRETIZATION_CC_SUBCONTROLVOLUME_HH
#include <optional>
#include <dune/common/fvector.hh>
#include <dumux/common/optional.hh>
#include <dumux/common/indextraits.hh>
#include <dumux/discretization/subcontrolvolumebase.hh>
......@@ -108,7 +109,6 @@ public:
// We want to use the default copy/move assignment.
// But since geometry is not copy assignable :( we
// have to construct it again
geometry_.release();
geometry_.emplace(other.geometry_.value());
center_ = other.center_;
elementIndex_ = other.elementIndex_;
......@@ -121,7 +121,6 @@ public:
// We want to use the default copy/move assignment.
// But since geometry is not copy assignable :( we
// have to construct it again
geometry_.release();
geometry_.emplace(std::move(other.geometry_.value()));
center_ = std::move(other.center_);
elementIndex_ = std::move(other.elementIndex_);
......@@ -188,7 +187,7 @@ public:
private:
// Work around the fact that geometry is not default constructible
Optional<Geometry> geometry_;
std::optional<Geometry> geometry_;
GlobalPosition center_;
GridIndexType elementIndex_;
};
......
......@@ -25,10 +25,10 @@
#define DUMUX_DISCRETIZATION_STAGGERED_SUBCONTROLVOLUMEFACE_HH
#include <utility>
#include <dune/common/fvector.hh>
#include <dune/geometry/type.hh>
#include <dumux/common/optional.hh>
#include <dumux/common/indextraits.hh>
#include <dumux/discretization/subcontrolvolumefacebase.hh>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment