OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
none.h
1 #pragma once
2 
3 #include <ozo/core/concept.h>
4 #include <type_traits>
5 
6 namespace ozo {
7 
13 struct none_t {
14  using type = void;
15  template <typename ...Args>
16  constexpr void operator() (Args&& ...) const noexcept {}
17  template <typename ...Args>
18  static constexpr void apply (Args&& ...) noexcept {}
19 };
20 
27 constexpr auto none = none_t{};
28 
29 template <>
30 struct is_time_constraint<none_t> : std::true_type {};
31 
32 inline constexpr std::true_type operator == (const none_t&, const none_t&) { return {};}
33 
34 template <typename T>
35 inline constexpr std::false_type operator == (const none_t&, const T&) { return {};}
36 
37 template <typename T>
38 inline constexpr std::false_type operator == (const T&, const none_t&) { return {};}
39 
40 inline constexpr std::false_type operator != (const none_t&, const none_t&) { return {};}
41 
42 template <typename T>
43 inline constexpr std::true_type operator != (const none_t&, const T&) { return {};}
44 
45 template <typename T>
46 inline constexpr std::true_type operator != (const T&, const none_t&) { return {};}
47 
48 template <typename T>
49 using is_none = decltype(std::declval<const T&>() == none);
50 
51 template <typename T>
52 inline constexpr auto IsNone = is_none<std::decay_t<T>>::value;
53 
54 } // namespace ozo
ozo::none
constexpr auto none
None object.
Definition: none.h:27
ozo::none_t
None type None type modelling void as ordinary type. This type is callable with return type void.
Definition: none.h:13