Maki
Loading...
Searching...
No Matches
null.hpp
1//Copyright Florian Goujeon 2021 - 2025.
2//Distributed under the Boost Software License, Version 1.0.
3//(See accompanying file LICENSE or copy at
4//https://www.boost.org/LICENSE_1_0.txt)
5//Official repository: https://github.com/fgoujeon/maki
6
7#ifndef MAKI_NULL_HPP
8#define MAKI_NULL_HPP
9
10#include <type_traits>
11
12namespace maki
13{
14
15namespace detail
16{
17 struct null_t_impl
18 {
19 };
20}
21
22#ifdef MAKI_DETAIL_DOXYGEN
26using null_t = IMPLEMENTATION_DETAIL;
27#else
28/*
29We need an integral type so that we can directly pass `null` as a template
30argument.
31*/
32using null_t = const detail::null_t_impl*;
33#endif
34
45#ifdef MAKI_DETAIL_DOXYGEN
46constexpr auto null = null_t{};
47#else
48inline constexpr auto null = null_t{nullptr};
49#endif
50
51namespace detail
52{
53 template<class T>
54 constexpr bool is_null_v = std::is_same_v<T, null_t>;
55}
56
57} //namespace
58
59#endif
The Maki library.
IMPLEMENTATION_DETAIL null_t
The type of maki::null
Definition null.hpp:26