3.0.0
Freundlich's C++ toolkit
Namespaces | Classes | Typedefs | Functions
fcppt::container Namespace Reference

Various containers and utility functions. More...

Namespaces

 array
 Functions for std::array.
 
 bitfield
 Contains fcppt::container::bitfield::object and helper types/functions for it.
 
 buffer
 
 grid
 Contains fcppt::container::grid::object and helper types/functions for it.
 
 raw_vector
 
 tree
 
 tuple
 Functions for std::tuple.
 

Classes

class  dynamic_array
 An array of dynamic size that does not initialize. More...
 
class  get_or_insert_result
 The result type of fcppt::container::get_or_insert_with_result. More...
 
class  index_map
 An index-based container that grows on demand. More...
 
class  move_range
 A range that moves its elements. More...
 

Typedefs

template<typename Range >
using size_result_type = std::make_unsigned_t< decltype(fcppt::container::detail::size(std::declval< Range >())) >
 The size type of a range. More...
 
template<typename Container >
using to_iterator_type = std::conditional_t< std::is_const< Container >::value, typename Container::const_iterator, typename Container::iterator >
 Gets the iterator type of a container. More...
 
template<typename Container >
using to_mapped_type = std::conditional_t< std::is_const< Container >::value, typename Container::mapped_type const, typename Container::mapped_type >
 Gets the mapped type of an associative container. More...
 
template<typename Container >
using to_pointer_type = std::conditional_t< std::is_const< Container >::value, typename Container::const_pointer, typename Container::pointer >
 Gets the pointer type of a container. More...
 
template<typename Container >
using to_reference_type = std::conditional_t< std::is_const< Container >::value, typename Container::const_reference, typename Container::reference >
 Gets the reference type of a container. More...
 
template<typename Container >
using to_value_type = std::conditional_t< std::is_const< Container >::value, fcppt::type_traits::value_type< Container > const, fcppt::type_traits::value_type< Container > >
 The value type of a container depending on its constness. More...
 

Functions

template<typename Container >
fcppt::optional::reference< fcppt::container::to_value_type< Container >> at_optional (Container &_container, typename Container::size_type const _index)
 Returns an element as an optional at a given position. More...
 
template<typename Container >
fcppt::container::to_pointer_type< Container > data (Container &_container)
 Returns a pointer the beginning of a random access container. More...
 
template<typename Container >
fcppt::container::to_pointer_type< Container > data_end (Container &_container)
 Returns a pointer one past the end of a random-access container> More...
 
template<typename Container , typename Key >
fcppt::optional::reference< fcppt::container::to_value_type< Container >> find_opt (Container &_container, Key const &_key)
 Returns an element from a find operation or an empty optional. More...
 
template<typename Container , typename Key >
fcppt::optional::object< fcppt::container::to_iterator_type< Container >> find_opt_iterator (Container &_container, Key const &_key)
 Returns an iterator from a find operation or an empty optional. More...
 
template<typename Container , typename Key >
fcppt::optional::object< fcppt::reference< fcppt::container::to_mapped_type< Container > >> find_opt_mapped (Container &_container, Key const &_key)
 Returns an element from a find operation or an empty optional. More...
 
template<typename Container , typename Create >
Container::mapped_type & get_or_insert (Container &_container, typename Container::key_type const &_key, Create const &_create)
 Gets from or inserts an element into a map. More...
 
template<typename Container , typename Create >
fcppt::container::get_or_insert_result< typename Container::mapped_type & > get_or_insert_with_result (Container &_container, typename Container::key_type const &_key, Create const &_create)
 Gets from or inserts an element into a map and returns if it was inserted. More...
 
template<typename Container , typename Value >
bool insert (Container &_container, Value &&_value)
 Inserts into an associative container. More...
 
template<typename Container , typename... Args>
fcppt::type_traits::remove_cv_ref_t< Container > join (Container &&_first, Args &&..._args)
 Joins two containers. More...
 
template<typename Set , typename Map >
Set key_set (Map const &_map)
 Creates a set of keys from a map. More...
 
template<typename Container , typename... Args>
Container make (Args &&... _args)
 Creates a container from variadic arguments by moving. More...
 
template<typename Container >
fcppt::container::move_range< std::remove_reference_t< Container >> make_move_range (Container &&_container)
 Creates a move range from a container. More...
 
template<typename Result , typename Map >
Result map_values_copy (Map const &_map)
 Copies the mapped values of an associative container into a container. More...
 
template<typename Result , typename Map >
Result map_values_ref (Map &_map)
 Maps the mapped values of an associative container to a container of references. More...
 
template<typename Container >
fcppt::optional::reference< fcppt::container::to_value_type< Container >> maybe_back (Container &_container)
 Returns the back of a container as an optional. More...
 
template<typename Container >
fcppt::optional::reference< fcppt::container::to_value_type< Container >> maybe_front (Container &_container)
 Returns the front of a container as an optional. More...
 
template<typename Container >
fcppt::container::detail::output< Container > output (Container const &_container) noexcept
 Creates a class that has an output operator to print a container. More...
 
template<typename Container >
fcppt::optional::object< fcppt::container::to_value_type< Container >> pop_back (Container &_container)
 Pops the back of a container as an optional. More...
 
template<typename Container >
fcppt::optional::object< fcppt::container::to_value_type< Container >> pop_front (Container &_container)
 Pops the front of a container as an optional. More...
 
template<typename Set >
Set set_difference (Set const &_a, Set const &_b)
 Returns the difference of two sets. More...
 
template<typename Set >
Set set_intersection (Set const &_a, Set const &_b)
 Returns the intersection of two sets. More...
 
template<typename Set >
Set set_union (Set const &_a, Set const &_b)
 Returns the union of two sets. More...
 
template<typename Range >
fcppt::container::size_result_type< Range > size (Range const &_range)
 The size of a range. More...
 

Detailed Description

Various containers and utility functions.