ValPack.hpp
A set of values that can be manipulated at compile time (good for metaprogramming)
Any built-in type can be added to ValPack to be manipulated at compile time.
Typedefs
-
template<auto START, auto END, auto STEP = 1>
using ValPackRange = typename internal::vp_range<(START >= END), START, END, STEP>::type Generate a ValPack with a specified range of values.
-
template<auto COUNT>
using ValPackCount = ValPackRange<0, COUNT, 1> Generate a count from 0 to COUNT-1 (so a total of COUNT values)
-
template<auto... Ts>
struct ValPack - #include <ValPack.hpp>
-
template<auto V1, auto... Vs>
struct ValPack<V1, Vs...> - #include <ValPack.hpp>
ValPack with at least one value.
Public Types
-
template<auto V, auto X>
using push_if_not = typename internal::vp_push_if_not<V, X, this_t>::result Push V onto front of an ValPack if it does not equal X.
-
template<auto V, auto X>
using push_back_if_not = typename internal::vp_push_if_not<V, X, this_t>::back Push V onto back of an ValPack if it does not equal X.
-
template<auto V>
using pop_val = typename internal::vp_loop<this_t, ValPack<>, false, 2>::template pop_val<V> Remove the first time value V appears from an ValPack.
-
template<auto V>
using remove = typename internal::vp_loop<this_t, ValPack<>, false, 3>::template remove<V> Remove the all appearances of value V from an ValPack.
Public Static Functions
-
template<typename T>
static inline constexpr bool Has(T val) —=== Member Functions ===—
Return wheter an ValPack contains the value V.
-
template<typename T>
static inline constexpr size_t Count(T val) Count the number of occurances of value V in ValPack.
-
template<typename T>
static inline constexpr int GetID(T val) Determine the position at which V appears in ValPack.
-
static inline constexpr size_t GetSize()
Function to retrieve number of elements in ValPack.
-
static inline constexpr bool IsEmpty()
Determine if there are NO value in an ValPack.
-
static inline constexpr bool IsUnique()
Determine if all values in ValPack are different from each other.
-
static inline constexpr auto Sum()
Add up all values in an ValPack.
-
static inline constexpr auto Product()
Multiply together all value in an ValPack.
-
template<typename T>
static inline constexpr auto Min(T cap) Find the smallest value in an ValPack, to a maximum of cap.
-
static inline constexpr auto Min()
Find the overall smallest value in an ValPack.
-
template<typename T>
static inline constexpr auto Max(T floor) Find the maximum value in an ValPack, to a minimum of floor.
-
static inline constexpr auto Max()
Find the overall maximum value in an ValPack.
-
static inline constexpr bool IsSorted()
Determine if the pack is sorted.
-
template<typename T>
static inline constexpr auto ApplyIndex(T &&container) Use each value in an ValPack as an index and return results as a tuple.
-
template<auto V, auto X>
-
template<>
struct ValPack<> - #include <ValPack.hpp>
Public Types
-
template<auto V, auto X>
using push_if_not = typename internal::vp_push_if_not<V, X, ValPack<>>::result
Public Static Functions
-
static inline constexpr size_t GetSize()
-
static inline constexpr bool IsEmpty()
-
static inline constexpr bool IsUnique()
-
static inline constexpr double Sum()
-
static inline constexpr double Product()
-
static inline constexpr bool IsSorted()
Public Static Attributes
-
static constexpr size_t SIZE = 0
-
template<auto V, auto X>
-
namespace pack
Typedefs