repr 0.1
Reconstructable string representations and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
range_list.h
Go to the documentation of this file.
#pragma once
#include <type_traits>
#include "range.h"
#include "util.h"
namespace librepr::ctei {
template <typename... Ranges>
struct RangeList : TypeListBase<RangeList, Ranges...>{
using last = typename RangeList::template get<0>;
constexpr static auto next_index = last::max + 1;
template <auto Idx>
typename RangeList::template prepend<Range<Idx>>
>;
template <typename T>
next_index == T::min,
typename RangeList::template prepend<T>
>;
template <typename T, auto V, auto Idx = V>
constexpr static bool is_binary_powers(){
return (Ranges::is_binary_powers() && ...);
}
};
template <>
struct RangeList<> : TypeListBase<RangeList> {
constexpr static auto full_size = 0;
template <auto Index>
template <typename T>
template <typename T, auto V, auto Idx = V>
constexpr static bool is_binary_powers(){
// special case empty range list to detect flags outside of initial search range
return true;
}
};
} // namespace librepr::ctei