attrs.hpp

TODO.

Defines

DEFINE_ATTR(NAME)
namespace tools

Functions

template<typename ...T>
constexpr Attrs<std::decay_t<T>...> MakeAttrs(T&&... props)

An alternative syntax for creating attribute packs. Takes any number of attributes and returns a pack containing each of those attributes.

template<typename I, typename R, typename ...A>
constexpr auto MergeReduce(I &&init, R &&reducer, A&&... attrs)
template<typename I, typename R, typename ...A>
constexpr auto Reduce(I &&init, R &&reducer, A&&... attrs)
template<typename F, typename ...A>
constexpr void MergeForeach(F &&callback, A&&... attrs)
template<typename F, typename ...A>
constexpr void Foreach(F &&callback, A&&... attrs)
template<typename ...U>
constexpr auto Merge(U&&... packs)
template<class H, class ...T>
std::ostream &operator<<(std::ostream &out, const Attrs<H, T...> &attrs)
std::ostream &operator<<(std::ostream &out, const Attrs<> &attrs)

Variables

template<typename T>
constexpr bool is_attribute_value_v = is_attribute_value<T>::value
template<typename T>
constexpr bool is_attributes_pack_v = is_attributes_pack<T>::value
template<typename Pack, typename Attr>
constexpr bool has_attribute_v = has_attribute<Pack, Attr>::value
template<typename ...T>
class Attrs
#include <attrs.hpp>

Public Types

using attributes_t = Attrs
using pack_t = TypePack<T...>

Public Functions

inline constexpr Attrs()
template<class U0, class ...U>
inline constexpr Attrs(U0 &&arg, U&&... args)
template<typename F>
inline Attrs &operator=(F &&from)
template<class ...U>
inline constexpr auto operator()(U&&... args) &

Provide a call operator for attribute packs. This will attempt to call each member of the attribute pack with the given arguments, and maps the result of that call into a new parameter pack as the same attribute. If one of the members of the pack cannot be called with the given pack, then it is put into the new pack unchanged. Mostly, this is meant to allow the opengl plotting library to do mapping operations

template<class ...U>
inline constexpr auto operator()(U&&... args) const &
template<class ...U>
inline constexpr auto operator()(U&&... args) &&
template<class ...U>
inline constexpr auto operator()(U&&... args) const &&
template<class ...U>
inline constexpr bool operator==(const Attrs<U...> &other) const

Attribute packs support equals and not equals, but are not orderable, as the members are not considered to be ordered from the user’s perspective.

template<typename I, typename F>
inline constexpr auto AttributeReduce(I &&init, F &&callback) &
template<typename I, typename F>
inline constexpr auto AttributeReduce(I &&init, F &&callback) const &
template<typename I, typename F>
inline constexpr auto AttributeReduce(I &&init, F &&callback) &&
template<typename I, typename F>
inline constexpr auto AttributeReduce(I &&init, F &&callback) const &&
template<typename I, typename F>
inline constexpr auto Reduce(I &&init, F &&callback)
template<typename I, typename F>
inline constexpr auto Reduce(I &&init, F &&callback) const
template<typename F>
inline constexpr void AttributeForeach(F &&callback) &
template<typename F>
inline constexpr void AttributeForeach(F &&callback) const &
template<typename F>
inline constexpr void AttributeForeach(F &&callback) &&
template<typename F>
inline constexpr void AttributeForeach(F &&callback) const &&
template<typename F>
inline constexpr void Foreach(F &&callback)
template<typename F>
inline constexpr void Foreach(F &&callback) const
template<typename U>
inline constexpr auto SetAttribute(U &&attribute) &
template<typename U>
inline constexpr auto SetAttribute(U &&attribute) const &
template<typename U>
inline constexpr auto SetAttribute(U &&attribute) &&
template<typename U>
inline constexpr auto SetAttribute(U &&attribute) const &&

Private Static Functions

template<typename S, typename ...U>
static inline constexpr auto Call(S &&Self, U&&... args)
struct eq_reducer

Public Functions

template<typename A, typename B>
inline constexpr bool operator()(bool init, A &&a, B &&b) const
template<bool Last, typename A>
struct GetAttr
template<typename A>
struct GetAttr<false, A>

Public Static Functions

template<typename S, typename ...U>
static inline constexpr decltype(auto) Get(S &&Self, U&&... args)
template<typename A>
struct GetAttr<true, A>

Public Static Functions

template<typename S, typename ...U>
static inline constexpr decltype(auto) Get(S &&Self, U&&... args)
template<typename Pack, typename Attr>
struct has_attribute : public __impl_has_attr::has_attribute::type<Pack, Attr>
#include <attrs.hpp>
template<typename T>
struct is_attribute_value : public std::is_base_of<value_tag, T>
#include <attrs.hpp>
template<typename T>
struct is_attributes_pack : public false_type
#include <attrs.hpp>
template<typename ...U>
struct is_attributes_pack<Attrs<U...>> : public true_type
#include <attrs.hpp>
template<typename V1, typename V2>
struct is_same_attribute : public std::is_same<V1::attribute_t, V2::attribute_t>
#include <attrs.hpp>
struct value_tag
#include <attrs.hpp>