Commit 4c498df6 authored by Matthias Vallentin's avatar Matthias Vallentin

Make none a totally ordered type

parent 8f328a1b
...@@ -20,15 +20,21 @@ ...@@ -20,15 +20,21 @@
#ifndef CAF_NONE_HPP #ifndef CAF_NONE_HPP
#define CAF_NONE_HPP #define CAF_NONE_HPP
#include "caf/detail/comparable.hpp"
namespace caf { namespace caf {
struct none_t { struct none_t : detail::comparable<none_t> {
constexpr none_t() { constexpr none_t() {
// nop // nop
} }
constexpr explicit operator bool() const { constexpr explicit operator bool() const {
return false; return false;
} }
constexpr int compare(none_t) const {
return 0;
}
}; };
static constexpr none_t none = none_t{}; static constexpr none_t none = none_t{};
......
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