Struct weight_fn

Struct Documentation

struct weight_fn

Customization point object type for accessing the weight of a particle.

See https://en.cppreference.com/w/cpp/ranges/cpo.

Public Functions

template<class T, std::enable_if_t<std::conjunction_v<has_member_variable_weight<T>, std::negation<has_member_weight<T>>, std::negation<has_non_member_weight<T>>>, int> = 0>
inline constexpr decltype(auto) operator()(T &&t) const noexcept

Overload for when the particle type defines a member variable.

template<class T, std::enable_if_t<std::conjunction_v<std::negation<has_member_variable_weight<T>>, has_member_weight<T>, std::negation<has_non_member_weight<T>>>, int> = 0>
inline constexpr decltype(auto) operator()(T &&t) const noexcept(noexcept(std::forward<T>(t).weight()))

Overload for when the particle type defines a member method.

template<class T, std::enable_if_t<std::conjunction_v<std::negation<has_member_variable_weight<T>>, std::negation<has_member_weight<T>>, has_non_member_weight<T>>, int> = 0>
inline constexpr decltype(auto) operator()(T &&t) const noexcept(noexcept(weight(std::forward<T>(t))))

Overload for when there is an external function that takes this particle type.

The non-member function must be in T’s namespace so it can be found by ADL.

template<class T, std::enable_if_t<std::conjunction_v<std::negation<has_member_variable_weight<T>>, std::negation<has_member_weight<T>>, std::negation<has_non_member_weight<T>>, is_tuple_like<T>, has_single_element<beluga::Weight, std::decay_t<T>>>, int> = 0>
inline constexpr decltype(auto) operator()(T &&t) const noexcept(noexcept(element<beluga::Weight>(std::forward<T>(t))))

Overload for tuple-like types.