Zen C++ Libraries
Zero-dependency re-usable components for C++
Loading...
Searching...
No Matches
compat.hpp
1
7#ifndef ZEN_COMPAT_HPP
8#define ZEN_COMPAT_HPP
9
10#include <iterator>
11
12#include "zen/config.hpp"
13
14ZEN_NAMESPACE_START
15
22template<std::indirectly_readable T>
23using iter_const_reference_t = std::common_reference_t<
24 const std::iter_value_t<T>&&,
25 std::iter_reference_t<T>
26>;
27
28template<typename T, typename ... U>
29concept neither = (!std::same_as<T, U> && ...);
30
31template<typename T>
32concept strict_unsigned_integral = std::unsigned_integral<T> &&
34
36constexpr bool has_single_bit(strict_unsigned_integral auto x) noexcept {
37 return x && !(x & (x - 1));
38}
39
40ZEN_NAMESPACE_END
41
42#endif // of #ifndef ZEN_COMPAT_HPP
Definition compat.hpp:29
Definition compat.hpp:32