mirror of
https://github.com/monero-project/monero.git
synced 2024-12-24 23:49:22 -05:00
Merge pull request #9638
cb54a0a
ci: common: remove duplicated definition (tobtoht)
This commit is contained in:
commit
941ecefab2
@ -214,35 +214,4 @@ public:
|
|||||||
bool is_empty() const noexcept { return this->index() == 0; }
|
bool is_empty() const noexcept { return this->index() == 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename... Types>
|
|
||||||
class optional_variant: public variant<boost::blank, Types...>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//constructors
|
|
||||||
/// default constructor
|
|
||||||
optional_variant() = default;
|
|
||||||
|
|
||||||
/// construct from variant type (use enable_if to avoid issues with copy/move constructor)
|
|
||||||
template <typename T,
|
|
||||||
typename std::enable_if<
|
|
||||||
!std::is_same<
|
|
||||||
std::remove_cv_t<std::remove_reference_t<T>>,
|
|
||||||
optional_variant<Types...>
|
|
||||||
>::value,
|
|
||||||
bool
|
|
||||||
>::type = true>
|
|
||||||
optional_variant(T &&value) : variant<boost::blank, Types...>(std::forward<T>(value)) {}
|
|
||||||
|
|
||||||
// construct like boost::optional
|
|
||||||
optional_variant(boost::none_t) {}
|
|
||||||
|
|
||||||
//overloaded operators
|
|
||||||
/// boolean operator: true if the variant isn't empty/uninitialized
|
|
||||||
explicit operator bool() const noexcept { return !this->is_empty(); }
|
|
||||||
|
|
||||||
//member functions
|
|
||||||
/// check if empty/uninitialized
|
|
||||||
bool is_empty() const noexcept { return this->index() == 0; }
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace tools
|
} //namespace tools
|
||||||
|
Loading…
Reference in New Issue
Block a user