cmoon::meta::value_list<Values...>::for_each





template<class F>
[[nodiscard]] static constexpr void for_each(F&& func) noexcept(/* see below */);


(1)

Invokes func for every value in Values....

Parameters

func - The function

Return value

(none)

Exceptions

1) noexcept specification:



noexcept(std::conjunction_v<std::is_nothrow_invocable<F, decltype(Values)>...>)


Example



import <iostream>

import cmoon.meta;

struct print_out
{
    std::ostream& os;

    template<class T>
    void operator()(T t)
    {
        os << t << '\n';
    }
};

int main()
{
    using vl = cmoon::meta::value_list<1, 5, 3, 'f', 203>;

    static_assert(vl::for_each(print_out{std::cout}));
}