Commit 5e245adc authored by Dominik Charousset's avatar Dominik Charousset

Explicitly provide `operator=` for `unit_t`

parent b6b0fe39
...@@ -23,11 +23,17 @@ ...@@ -23,11 +23,17 @@
namespace caf { namespace caf {
struct unit_t { struct unit_t {
constexpr unit_t() {} constexpr unit_t() {
constexpr unit_t(const unit_t&) {} // nop
}
constexpr unit_t(const unit_t&) {
// nop
}
template <class T> template <class T>
explicit constexpr unit_t(T&&) {} explicit constexpr unit_t(T&&) {
// nop
}
unit_t& operator=(const unit_t&) = default;
}; };
static constexpr unit_t unit = unit_t{}; static constexpr unit_t unit = unit_t{};
...@@ -35,25 +41,21 @@ static constexpr unit_t unit = unit_t{}; ...@@ -35,25 +41,21 @@ static constexpr unit_t unit = unit_t{};
template <class T> template <class T>
struct lift_void { struct lift_void {
using type = T; using type = T;
}; };
template <> template <>
struct lift_void<void> { struct lift_void<void> {
using type = unit_t; using type = unit_t;
}; };
template <class T> template <class T>
struct unlift_void { struct unlift_void {
using type = T; using type = T;
}; };
template <> template <>
struct unlift_void<unit_t> { struct unlift_void<unit_t> {
using type = void; using type = void;
}; };
} // namespace caf } // namespace caf
......
Markdown is supported
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