4.4.1
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
fcppt::array Namespace Reference

Classes

class  object
 

Typedefs

template<typename T , typename = std::enable_if_t<fcppt::array::is_object<T>::value>>
using impl_type = typename T::impl_type
 
template<typename T >
using is_object = typename fcppt::array::detail::is_object< T >::type
 Tests whether a type is a array.
 
template<typename Array , typename = std::enable_if_t<fcppt::array::is_object<Array>::value>>
using size = std::integral_constant< std::size_t, std::tuple_size_v< fcppt::array::impl_type< Array > > >
 Gets the size of an array.
 
template<typename Array , typename = std::enable_if_t<fcppt::array::is_object<Array>::value>>
using value_type = fcppt::type_traits::value_type< Array >
 The value type of an array.
 

Functions

template<typename Array1 , typename Array2 , typename = std::enable_if_t<std::conjunction_v< fcppt::array::is_object<std::remove_cvref_t<Array1>>, fcppt::array::is_object<std::remove_cvref_t<Array2>>, std::is_same< fcppt::array::value_type<std::remove_cvref_t<Array1>>, fcppt::array::value_type<std::remove_cvref_t<Array2>>>>>>
fcppt::array::object< fcppt::array::value_type< std::remove_cvref_t< Array1 > >, fcppt::array::size< std::remove_cvref_t< Array1 > >::value+fcppt::array::size< std::remove_cvref_t< Array2 > >::value > append (Array1 &&_array1, Array2 &&_array2)
 Appends two arrays.
 
template<typename Function , typename Array1 , typename... Arrays, typename = std::enable_if_t<std::conjunction_v< fcppt::array::is_object<std::remove_cvref_t<Array1>>, fcppt::array::is_object<std::remove_cvref_t<Arrays>>..., std::is_same< fcppt::array::size<std::remove_cvref_t<Array1>>, fcppt::array::size<std::remove_cvref_t<Arrays>>>...>>>
auto apply (Function const &_function, Array1 &&_array1, Arrays &&..._arrays) -> fcppt::array::object< decltype(_function(fcppt::move_if_rvalue< Array1 >(std::declval< fcppt::container::to_reference_type< std::remove_reference_t< Array1 > > >()), fcppt::move_if_rvalue< Arrays >(std::declval< fcppt::container::to_reference_type< std::remove_reference_t< Arrays > > >())...)), fcppt::array::size< std::remove_cvref_t< Array1 > >::value >
 Applies a function to each tuple of elements of multiple arrays and returns an array containing the results.
 
template<typename T , std::size_t Size>
bool operator== (fcppt::array::object< T, Size > const &a, fcppt::array::object< T, Size > const &b)
 Compares two arrays for equality.
 
template<std::size_t Size, typename Source >
fcppt::optional::object< fcppt::array::object< fcppt::type_traits::value_type< std::remove_cvref_t< Source > >, Size > > from_range (Source &&_source)
 Creates an fcppt::array::object out of a range.
 
template<std::size_t I, typename T , std::size_t Size, typename = std::enable_if_t<std::less<>{}(I, Size)>>
constexpr Tget (fcppt::array::object< T, Size > &_value) noexcept
 Returns the I'th element of a nonconst array.
 
template<std::size_t I, typename T , std::size_t Size, typename = std::enable_if_t<std::less<>{}(I, Size)>>
constexpr T constget (fcppt::array::object< T, Size > const &_value) noexcept
 Returns the I'th element of a const array.
 
template<typename Array , typename Function , typename = std::enable_if_t<fcppt::array::is_object<Array>::value>>
Array init (Function const &_function)
 Constructs an array by calling a function with static indices.
 
template<typename Array1 , typename... Arrays, typename = std::enable_if_t<std::conjunction_v< fcppt::array::is_object<std::remove_cvref_t<Array1>>, fcppt::array::is_object<std::remove_cvref_t<Arrays>>..., std::is_same< fcppt::array::value_type<std::remove_cvref_t<Array1>>, fcppt::array::value_type<std::remove_cvref_t<Arrays>>>...>>>
fcppt::array::object< fcppt::array::value_type< std::remove_cvref_t< Array1 > >, fcppt::mpl::list::fold< fcppt::mpl::list::object< std::remove_cvref_t< Arrays >... >, fcppt::mpl::bind< fcppt::mpl::lambda< fcppt::mpl::add >, fcppt::mpl::bind< fcppt::mpl::lambda< fcppt::array::size >, fcppt::mpl::arg< 1 > >, fcppt::mpl::arg< 2 > >, fcppt::array::size< std::remove_cvref_t< Array1 > > >::value > join (Array1 &&_array1, Arrays &&..._arrays)
 Appends multiple arrays.
 
template<typename Arg1 , typename... Args, typename = std::enable_if_t<std::conjunction_v<std::is_same< std::remove_cvref_t<Arg1>, std::remove_cvref_t<Args>>...>>>
fcppt::array::object< std::remove_cvref_t< Arg1 >, sizeof...(Args)+1Umake (Arg1 &&_arg1, Args &&..._args)
 Make an array out of a parameter pack.
 
template<typename Array , typename Function , typename = std::enable_if_t< fcppt::array::is_object<std::remove_cvref_t<Array>>::value>>
auto map (Array &&_source, Function const &_function) -> fcppt::array::object< decltype(_function(fcppt::move_if_rvalue< Array >(std::declval< fcppt::container::to_reference_type< std::remove_reference_t< Array > > >()))), fcppt::array::size< std::remove_cvref_t< Array > >::value >
 Applies a function to every element of an array and returns an array of the results.
 
template<typename Ch , typename Traits , typename Type , std::size_t Size>
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &_stream, fcppt::array::object< Type, Size > const &_array)
 Outputs an array to a stream.
 
template<typename Source , typename NewElement , typename = std::enable_if_t<std::conjunction_v< fcppt::array::is_object<std::remove_cvref_t<Source>>, std::is_same< std::remove_cvref_t<NewElement>, fcppt::array::value_type<std::remove_cvref_t<Source>>>>>>
fcppt::array::object< fcppt::type_traits::value_type< std::remove_cvref_t< Source > >, fcppt::array::size< std::remove_cvref_t< Source > >::value+1Upush_back (Source &&_source, NewElement &&_new_element)
 Pushes a new element to the back of an array.
 

Typedef Documentation

◆ impl_type

template<typename T , typename = std::enable_if_t<fcppt::array::is_object<T>::value>>
using fcppt::array::impl_type = typedef typename T::impl_type

◆ size

template<typename Array , typename = std::enable_if_t<fcppt::array::is_object<Array>::value>>
using fcppt::array::size = typedef std::integral_constant<std::size_t,std::tuple_size_v<fcppt::array::impl_type<Array> >>

Gets the size of an array.

Function Documentation

◆ from_range()

template<std::size_t Size, typename Source >
fcppt::optional::object< fcppt::array::object< fcppt::type_traits::value_type< std::remove_cvref_t< Source > >, Size > > fcppt::array::from_range ( Source &&  _source)

Creates an fcppt::array::object out of a range.

Template Parameters
SourceMust be a random-access range.