3.0.0
Freundlich's C++ toolkit
Typedefs | Functions
fcppt::brigand Namespace Reference

Brigand related helper functions and metafunctions. More...

Typedefs

template<typename Sequence , typename Predicate >
using all_of = typename fcppt::brigand::detail::all_of_impl< Sequence, Predicate >::type
 Checks if a predicate is true for every element. More...
 
template<typename Type , Type Dividend, Type Divisor>
using ceil_div = typename fcppt::brigand::detail::ceil_div< Type, Dividend, Divisor >::type
 Calculates a division of integral contants rounded towards infinity. More...
 
template<typename Enum >
using enum_range = fcppt::brigand::enum_range_start_end< Enum, fcppt::enum_::min_value< Enum >::value, fcppt::enum_::max_value< Enum >::value >
 A brigand range over enums. More...
 
template<typename Enum , Enum Start, Enum Max>
using enum_range_start_end = ::brigand::transform< ::brigand::range< 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) >, ::brigand::bind< fcppt::brigand::integral_cast, Enum, fcppt::cast::int_to_enum_fun, ::brigand::_1 > >
 A brigand range over enums from a minimum to a maximum. More...
 
template<typename Sequence1 , typename Sequence2 >
using equal_to = ::brigand::all< ::brigand::transform< Sequence1, Sequence2, ::brigand::bind< ::brigand::apply, ::brigand::bind< ::brigand::equal_to, ::brigand::_1, ::brigand::_2 > > >, ::brigand::identity< ::brigand::_1 > >
 Checks if two sequences of integral constants are equal. More...
 
template<typename Map >
using flip_map = ::brigand::transform< Map, ::brigand::bind< fcppt::brigand::flip_pair, ::brigand::_1 > >
 Flips a brigand map. More...
 
template<typename Pair >
using flip_pair = ::brigand::pair< fcppt::brigand::pair_second< Pair >, fcppt::brigand::pair_first< Pair > >
 Flips a brigand pair. More...
 
template<typename Sequence , typename Type >
using found_t = ::brigand::found< Sequence, ::brigand::bind< std::is_same, ::brigand::pin< Type >, ::brigand::_1 > >
 Checks if a sequence contains an element. More...
 
template<typename Left , typename Right >
using implication = ::brigand::or_< ::brigand::not_< Left >, Right >
 The implication function: Left -> Right. More...
 
template<typename IntegralType , typename Conv , typename Integral >
using integral_cast = std::integral_constant< IntegralType, fcppt::brigand::detail::integral_cast_value< IntegralType, Conv, Integral >::value >
 Does an integral cast on an integral constant. More...
 
template<typename Sequence >
using is_set = typename fcppt::brigand::detail::is_set< Sequence >::type
 Checks if a sequence does not contain a type multiple times. More...
 
template<typename Type , Type... Values>
using list_c = ::brigand::list< std::integral_constant< Type, Values >... >
 A list of integral_constants. More...
 
template<typename Sequence >
using max_value = ::brigand::fold< Sequence, ::brigand::front< Sequence >, ::brigand::if_< ::brigand::bind< ::brigand::greater, ::brigand::_state, ::brigand::_element >, ::brigand::_state, ::brigand::_element > >
 Calculates the maximum value in a sequence. More...
 
template<typename Type >
using numeric_max = std::integral_constant< Type, std::numeric_limits< Type >::max() >
 Metafunction to compute the maximum value of a type. More...
 
template<typename Pair >
using pair_first = typename Pair::first_type
 The first type of a pair. More...
 
template<typename Pair >
using pair_second = typename Pair::second_type
 The second type of a pair. More...
 
template<typename Sequence , typename IntType = int>
using partial_sums = ::brigand::fold< Sequence, fcppt::brigand::list_c< IntType, 0 >, ::brigand::bind< ::brigand::push_back, ::brigand::_state, ::brigand::bind< ::brigand::plus, ::brigand::bind< ::brigand::back, ::brigand::_state >, ::brigand::_element > > >
 Calculates a new sequence that consists of the sums of the old sequence. More...
 
template<typename Set1 , typename Set2 >
using set_difference = ::brigand::fold< Set1, ::brigand::set<>, ::brigand::if_< ::brigand::bind< ::brigand::has_key, ::brigand::pin< Set2 >, ::brigand::_element >, ::brigand::_state, ::brigand::bind< ::brigand::insert, ::brigand::_state, ::brigand::_element > > >
 The difference of two sets. More...
 
template<typename Set1 , typename Set2 >
using set_intersection = ::brigand::fold< Set1, ::brigand::set<>, ::brigand::if_< ::brigand::bind< ::brigand::has_key, ::brigand::pin< Set2 >, ::brigand::_element >, ::brigand::bind< ::brigand::insert, ::brigand::_state, ::brigand::_element >, ::brigand::_state > >
 The intersection of two sets. More...
 
template<typename Set1 , typename Set2 >
using set_symmetric_difference = fcppt::brigand::set_union< fcppt::brigand::set_difference< Set1, Set2 >, fcppt::brigand::set_difference< Set2, Set1 > >
 The symmetric difference of two sets. More...
 
template<typename Set1 , typename Set2 >
using set_union = ::brigand::fold< Set1, Set2, ::brigand::bind< ::brigand::insert, ::brigand::_state, ::brigand::_element > >
 The union of two sets. More...
 
template<typename Sequence >
using unique = ::brigand::as_list< ::brigand::fold< Sequence, ::brigand::set<>, ::brigand::bind< ::brigand::insert, ::brigand::_state, ::brigand::_element > > >
 Removes duplicates from a sequence. More...
 

Functions

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 brigand sequence. More...
 
template<typename MaxIndex , typename Index , typename Function , typename FailFunction >
decltype(auto) runtime_index (Index const _index, Function const &_function, FailFunction const &_fail_function)
 Transforms a runtime index into a an integral constant. More...
 
template<typename Sequence >
fcppt::string sequence_to_string ()
 Converts a sequence to a string. More...
 

Detailed Description

Brigand related helper functions and metafunctions.