Freundlich's C++ toolkit
Namespaces | Typedefs | Functions
fcppt::metal Namespace Reference

Metal related helper functions and metafunctions. More...




template<template< typename... > class Type, typename List >
using as = typename fcppt::metal::detail::as< Type, List >::type
 Turns a metal list into another type. More...
template<typename List >
using as_tuple = fcppt::metal::as< fcppt::tuple::object, List >
 Turns a metal list into a tuple. More...
template<typename List , typename Value >
using contains = fcppt::type_traits::to_bool<::metal::contains< List, Value > >
 Like metal::contains, but returning a boolean. More...
template<typename Enum >
using enum_range = fcppt::metal::enum_range_start_end< Enum, fcppt::enum_::min_value< Enum >::value, fcppt::enum_::max_value< Enum >::value >
 A metal range over enums. More...
template<typename Enum , Enum Start, Enum Max>
using enum_range_start_end = ::metal::transform< ::metal::bind< ::metal::lambda< fcppt::type_traits::integral_cast >, ::metal::always< Enum >, ::metal::always< fcppt::cast::int_to_enum_fun >, ::metal::_1 >, fcppt::metal::interval< std::underlying_type_t< Enum >, fcppt::cast::enum_to_int< std::underlying_type_t< Enum > >(Start), fcppt::cast::enum_to_int< std::underlying_type_t< Enum > >(Max)+fcppt::literal< std::underlying_type_t< Enum > >(1)> >
 A metal range over enums from a minimum to a maximum. More...
template<typename Map >
using flip_map = typename fcppt::metal::detail::flip_map< Map >::type
 Flips a metal map. More...
template<typename Pair >
using flip_pair = ::metal::pair<::metal::second< Pair >, ::metal::first< Pair > >
 Flips a metal pair. More...
template<typename Dest , typename Number >
using from_number = typename fcppt::metal::detail::from_number< Dest, Number >::type
 Turns a metal::number into a std::integral_constant. More...
template<typename Result , typename List >
using from_number_list = ::metal::transform< ::metal::bind<::metal::lambda< fcppt::metal::from_number >, ::metal::always< Result >, ::metal::_1 >, List >
 Converts a metal::list of metal::numbers into a metal::list of std::integral_constants. More...
template<typename Function >
using function_args = typename fcppt::metal::detail::function_args< Function >::type
 The argument types of a function as a metal::list. More...
template<typename List , typename Type >
using index_of = typename fcppt::metal::detail::index_of< List, Type >::type
 Returns the index of an element of a metal::list. More...
template<typename List , typename Pred >
using index_of_if = typename fcppt::metal::detail::index_of_if< List, Pred >::type
 Returns the index of an element of a metal::list that matches a predicate. More...
template<typename Type , Type Begin, Type End>
using interval = typename fcppt::metal::detail::interval< Type, Begin, End >::type
 Creates a list of std::integral_constants that form an interval. More...
template<typename F , typename L >
using is_invocable = ::metal::apply<::metal::lambda< std::is_invocable >,::metal::prepend< L, F > >
template<typename List >
using is_set = std::is_same< ::metal::size< List >, fcppt::metal::set::size< fcppt::metal::set::from_list_relaxed< List > >>
 Checks if every element is unique in a metal::list. More...
template<typename Map1 , typename Map2 >
using maps_equal = fcppt::type_traits::to_bool<::metal::invoke<::metal::if_< ::metal::as_number< std::is_same< fcppt::metal::set::symmetric_difference< fcppt::metal::set::from_list_relaxed<::metal::keys< Map1 > >, fcppt::metal::set::from_list_relaxed<::metal::keys< Map2 > >>, fcppt::metal::set::make<> >>, ::metal::bind< ::metal::lambda< fcppt::metal::detail::map_same_values >, ::metal::always< Map1 >, ::metal::always< Map2 > >, ::metal::always<::metal::false_ > >> >
 Checks if two metal::maps are equal. More...
template<typename Sequence >
using max_value = fcppt::metal::from_number< fcppt::type_traits::value_type<::metal::front< Sequence > >, ::metal::accumulate< ::metal::bind< ::metal::lambda<::metal::if_ >, ::metal::bind<::metal::lambda<::metal::greater >, ::metal::_1, ::metal::_2 >, ::metal::_1, ::metal::_2 >, ::metal::front< fcppt::metal::to_number_list< Sequence > >, fcppt::metal::to_number_list< Sequence > >>
 Calculates the maximum value in a sequence. More...
template<typename Sequence >
using partial_sums = ::metal::accumulate< ::metal::bind< ::metal::lambda<::metal::append >, ::metal::_1, ::metal::bind< ::metal::lambda<::metal::add >, ::metal::bind<::metal::lambda<::metal::back >, ::metal::_1 >, ::metal::_2 > >, ::metal::list<::metal::number< 0 > >, Sequence >
 Calculates a new sequence that consists of the sums of the old sequence. More...
template<typename Src >
using to_number = fcppt::type_traits::safe_integral_cast<::metal::int_, Src >
 Converts a std::integral_constant to a metal::number. More...
template<typename List >
using to_number_list = ::metal::transform<::metal::lambda< fcppt::metal::to_number >, List >
 Converts a metal::list of std::integral_constants into a metal::list of metal::numbers. More...
template<typename Sequence >
using unique = fcppt::metal::set::to_list< fcppt::metal::set::from_list_relaxed< Sequence > >
 Removes duplicates from a metal::list. More...


template<typename Sequence , typename Function >
void for_each_break (Function const &_function)
 Invoke a function on each element of a sequence while giving the ability to break out of the loop. More...
template<typename Sequence , typename Index , typename Function , typename FailFunction >
decltype(auto) FCPPT_PP_PUSH_WARNING invoke_on (Index const &_index, Function const &_function, FailFunction const &_fail_function)
 Applies a function to the nth element of a sequence with a runtime index. More...
template<typename Sequence >
fcppt::io::ostreamprint (fcppt::io::ostream &_stream)
 Pretty prints a metal list. More...
template<typename Sequence >
fcppt::string sequence_to_string ()
 Converts a sequence to a string. More...

Detailed Description

Metal related helper functions and metafunctions.

Typedef Documentation

◆ is_invocable

template<typename F , typename L >
using fcppt::metal::is_invocable = typedef ::metal::apply<::metal::lambda<std::is_invocable>,::metal::prepend<L,F> >