Calico
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups
cal Namespace Reference

Primary namespace. More...

Classes

struct  add_const
 Adds the const qualifier to the type. More...
 
struct  add_cv
 Adds both the const and volatile qualifiers to the type. More...
 
struct  add_lvalue_reference
 Converts the type into an lvalue reference. More...
 
struct  add_pointer
 Converts into a pointer type. More...
 
struct  add_rvalue_reference
 Converts the type into an rvalue reference, unless T is an lvalue reference, in which case the type is returned unchanged. If rvalue references are not supported, the type is returned unchanged. More...
 
struct  add_volatile
 Adds the volatile qualifier to the type. More...
 
struct  combine_tuples
 Combines several tuple types into a single tuple type. More...
 
struct  common_type
 Returns a common type among the given types. Without support for variadic templates, this template can only support 2 template arguments. Without decltype support, the common type is only defined if the types are thes same). More...
 
struct  conditional
 Returns one of the types based on a boolean condition. More...
 
struct  container_base
 CRTP base type for defining an mutable, iterable container. More...
 
struct  counted_iterator
 An iterator adapter that counts the offset as the iterator moves. More...
 
struct  decay
 Performs lvalue transformations and removes cv-qualifiers. More...
 
struct  enable_if
 Contains a type member equal to T if Condition is true. More...
 
struct  extent
 Obtains the number of elements along the N-th dimension (or zero if unknown or outside bounds). More...
 
struct  get_iterator
 Obtains the default iterator type of a container or array (deprecated). More...
 
struct  input_iterator_base
 CRTP base type for implementing input iterators. More...
 
struct  integer_iterator
 An RandomAccessIterator that stores an integer value of type T. The dereferenced value of the iterator is the integer itself. More...
 
struct  integral_constant
 Represents a compile-time constant of integral type. More...
 
struct  is_abstract
 Checks if a type is an abstract type. More...
 
struct  is_arithmetic
 Returns whether the type is an integral or floating-point type. More...
 
struct  is_array
 Returns whether the type is an array type. More...
 
struct  is_base_of
 Checks if a type is derived from another type. More...
 
struct  is_const
 Returns whether the type is const-qualified. More...
 
struct  is_convertible
 Checks if the type From can be converted to To. More...
 
struct  is_floating_point
 Returns whether the type is a floating-point type (only works on fundamental types). More...
 
struct  is_function
 Returns whether the the type is a function type (up to 5 arguments if variadic templates are not supported). More...
 
struct  is_integral
 Returns whether the type is an integral type (only works on fundamental types). More...
 
struct  is_lvalue_reference
 Returns whether the type is an lvalue or rvalue reference. More...
 
struct  is_pointer
 Returns whether the type is an object pointer type. More...
 
struct  is_reference
 Returns whether the type is an lvalue or rvalue reference. More...
 
struct  is_rvalue_reference
 Returns whether the type is an rvalue reference. More...
 
struct  is_same
 Returns whether the types are the same. More...
 
struct  is_void
 Returns whether the type is a void type. More...
 
struct  is_volatile
 Returns whether the type is volatile-qualified. More...
 
struct  iterator_range
 An container-like type defined by a pair of iterators. More...
 
struct  iterator_type
 Returns the iterator type of the given container-like type. More...
 
struct  lens_base
 CRTP base type for constructing Lens types. More...
 
struct  lens_traits
 Traits class for the Lens concept. More...
 
struct  make_signed
 Converts an integral type to a signed type (only works on fundamental types, excluding char). More...
 
struct  make_unsigned
 Converts an integral type to a unsigned type (only works on fundamental types, excluding char). More...
 
struct  match_cv
 Obtains a type related to T with the same const-volatile qualifiers as Target. More...
 
struct  negating_lens
 A lens that negates the value before storing or accessing it. More...
 
struct  ntuple
 Constructs a tuple type containing N objects of type T. More...
 
class  null_terminated_iterator
 A ForwardIterator that traverses a null-terminated array. More...
 
class  nullopt_t
 A type that represents a missing value for optional. More...
 
class  optional
 Represents an optional value. More...
 
struct  packed_params
 A wrapper function type that allows a function to be called with a tuple whose elements are unpacked as arguments. More...
 
struct  rank
 Returns the number of dimensions in the array type. More...
 
struct  remove_all_extents
 Removes all the dimensions of an array type. More...
 
struct  remove_const
 Removes the const qualifier from the type. More...
 
struct  remove_cv
 Removes both the const and volatile qualifiers from the type. More...
 
struct  remove_extent
 Removes the first dimension of an array type. More...
 
struct  remove_pointer
 Converts to a non-pointer type. More...
 
struct  remove_reference
 Converts to a non-reference type. More...
 
struct  remove_volatile
 Removes the volatile qualifier from the type. More...
 
struct  result_of
 Deduces the return type of a function call (up to 5 arguments if variadic templates are not supported). If decltype is not available, it will use the result_type member of the function. More...
 
struct  scaling_lens
 A lens that scales the value by a factor before storing or accessing it. More...
 
struct  transform_iterator
 An iterator that applies a function to each element. More...
 
struct  unparenthesize_type< void(T)>
 Used to remove parentheses around a type expression: when a type T is passed in as a function type of the form void(T), a typedef named type is provided to recover the type T. More...
 
struct  unparenthesize_type< void(TypeExpression)>
 Used to remove parentheses around a type expression. More...
 
struct  valid_call
 Returns whether the function call is valid. When the template parameter is equal to F(T...), it will return true if the function object F can be called with parameters of type T.... If variadic templates are not supported, a maximum of 5 arguments are supported. More...
 

Typedefs

template<class... Tuples>
using combine_tuples_t = combine_tuples< Tuples...>::type
 
typedef integral_constant
< bool, false > 
false_type
 An alias to integral_constant with a value of false.
 
template<class T >
using iterator_type_t = iterator_type< T >::type
 
template<class T , class Target >
using match_cv_t = match_cv< T, Target >::type
 
template<class T , std::size_t N>
using ntuple_t = ntuple< T, N >::type
 
typedef integral_constant
< bool, true > 
true_type
 An alias to integral_constant with a value of true.
 
typedef unsigned uint_fast16_t
 Fastest unsigned integer type with a width of at least 16 bits.
 
template<class T >
using unparenthesize_type_t = unparenthesize_type< T >::type
 

Functions

template<class T >
T * addressof (T &x)
 Obtains the address of an object even if operator& is overloaded.
 
template<class C >
auto begin (C &c)
 Returns an iterator to the beginning of a container.
 
template<class C >
auto begin (const C &c)
 Returns an iterator to the beginning of a container.
 
template<class T , std::size_t N>
T * begin (T(&array)[N])
 Returns an iterator to the beginning of an array.
 
template<class C >
auto cbegin (const C &c)
 Returns a const-qualified iterator to the beginning of a container.
 
template<class C >
auto cend (const C &c)
 Returns a const-qualified iterator to the end of a container.
 
template<class T >
add_rvalue_reference< T >::type declval ()
 Converts a type into an unevaluated operand.
 
template<class C >
auto end (C &c)
 Returns an iterator to the end of a container.
 
template<class C >
auto end (const C &c)
 Returns an iterator to the end of a container.
 
template<class T , std::size_t N>
T * end (T(&array)[N])
 Returns an iterator to the end of an array.
 
template<class... T>
std::string format_str (const char *format, T &&...t)
 Returns a formatted string similar to sprintf but without all the hassle of memory management. More...
 
template<class T >
constexpr T && forward (typename remove_reference< T >::type &&t)
 Perfectly forwards the given argument.
 
template<class Container >
auto index_range (const Container &c)
 Returns the range of indices in a container.
 
template<class T >
iterator_range
< integer_iterator< T > > 
integer_range (const T &end)
 Returns the range of integers in T() (inclusive) to end (exclusive).
 
template<class T >
iterator_range
< integer_iterator< T > > 
integer_range (const T &begin, const T &end)
 Returns the range of integers in begin (inclusive) to end (exclusive).
 
template<class Iterator >
counted_iterator< Iterator > iterator_counter (const Iterator &iterator, counted_iterator< Iterator >::difference_type init_count=counted_iterator< Iterator >::difference_type())
 Constructs a counted_iterator with an initial count. More...
 
template<class T >
negating_lens< T > make_negating_lens (T &&x)
 Constructs a negating_lens from a given value.
 
template<class InputIterator >
iterator_range< InputIterator > make_range (const InputIterator &first, const InputIterator &last)
 Constructs an iterator_range.
 
template<class T , class U >
scaling_lens< T, U > make_scaling_lens (T &&lens, U &&factor)
 Constructs a scaling_lens from a given value.
 
template<class InputIterator , class UnaryOperation >
transform_iterator
< InputIterator,
UnaryOperation > 
make_transform_iterator (const InputIterator &it, const UnaryOperation &op)
 Constructs a transform_iterator.
 
template<class T >
remove_reference< T >::type && move (T &&t)
 Converts an rvalue reference into an xvalue.
 
template<class T >
null_terminated_iterator< T > null_terminated_begin (T *ptr)
 Returns a ForwardIterator to the first element of a null-terminated array. More...
 
template<class T >
null_terminated_iterator< T > null_terminated_end (T *ptr)
 Returns a past-the-end ForwardIterator for a null-terminated array. More...
 
template<class I , class J , class D , class E >
auto operator!= (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator!= (const I &i, const counted_iterator< J, D > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator!= (const counted_iterator< I, D > &i, const J &j)
 Compares the underlying iterators.
 
template<class I , class F >
auto operator!= (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Compares the underlying iterators.
 
template<class I , class D , class N >
auto operator+ (const counted_iterator< I, D > &i, N n)
 Returns an iterator in which the underlying iterator and the counter are both advanced by n.
 
template<class I , class D , class N >
auto operator+ (N n, const counted_iterator< I, D > &i)
 Returns an iterator advanced by the given number of steps.
 
template<class I , class F >
auto operator+ (const transform_iterator< I, F > &i, transform_iterator< I, F >::difference_type n)
 Returns an iterator advanced by n.
 
template<class I , class F >
auto operator+ (transform_iterator< I, F >::difference_type n, const transform_iterator< I, F > &i)
 Returns an iterator advanced by n.
 
template<class I , class D , class N >
auto operator- (const counted_iterator< I, D > &i, N n)
 Returns an iterator in which the underlying iterator and the counter are both advanced by n in reverse.
 
template<class I , class J , class D , class E >
auto operator- (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Returns the distance between two iterators.
 
template<class I , class J , class D >
auto operator- (const I &i, const counted_iterator< J, D > &j)
 Returns the distance between two iterators.
 
template<class I , class J , class D >
auto operator- (const counted_iterator< I, D > &i, const J &j)
 Returns the distance between two iterators.
 
template<class I , class F >
auto operator- (const transform_iterator< I, F > &i, transform_iterator< I, F >::difference_type n)
 Returns an iterator advanced by n in reverse.
 
template<class I , class F >
auto operator- (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Returns the distance between two iterators.
 
template<class I , class J , class D , class E >
auto operator< (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator< (const I &i, const counted_iterator< J, D > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator< (const counted_iterator< I, D > &i, const J &j)
 Compares the underlying iterators.
 
template<class I , class F >
auto operator< (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D , class E >
auto operator<= (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator<= (const I &i, const counted_iterator< J, D > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator<= (const counted_iterator< I, D > &i, const J &j)
 Compares the underlying iterators.
 
template<class I , class F >
auto operator<= (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D , class E >
auto operator== (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator== (const I &i, const counted_iterator< J, D > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator== (const counted_iterator< I, D > &i, const J &j)
 Compares the underlying iterators.
 
template<class I , class F >
auto operator== (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D , class E >
auto operator> (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator> (const I &i, const counted_iterator< J, D > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator> (const counted_iterator< I, D > &i, const J &j)
 Compares the underlying iterators.
 
template<class I , class F >
auto operator> (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D , class E >
auto operator>= (const counted_iterator< I, D > &i, const counted_iterator< J, E > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator>= (const I &i, const counted_iterator< J, D > &j)
 Compares the underlying iterators.
 
template<class I , class J , class D >
auto operator>= (const counted_iterator< I, D > &i, const J &j)
 Compares the underlying iterators.
 
template<class I , class F >
auto operator>= (const transform_iterator< I, F > &i, const transform_iterator< I, F > &j)
 Compares the underlying iterators.
 
template<class Function >
auto pack_params (const Function &f)
 Constructs a wrapper function object that allows a function to be called with a tuple whose elements are unpacked as arguments.
 
template<class T >
parse (const std::string &s)
 Extracts an object of type T from a string using the stream extraction operator (>>).
 
template<class T >
parse (const char *s)
 Extracts an object of type T from a string using the stream extraction operator (>>).
 
template<class Container >
auto reverse_range (const Container &c)
 Reverses a container or iterator range. More...
 
template<class T >
std::vector< T > str_to_vector (const std::basic_string< T > &s)
 Returns a copy of the given string as a vector of characters. More...
 
std::string to_string (const std::string &s)
 Returns a copy of the same string.
 
std::string to_string (const char *s)
 Converts a null-terminated string to an std::string.
 
std::string to_string (char c)
 Converts a character to a string.
 
template<class T >
std::string to_string (const T &x)
 Constructs a string representation of an object using the stream insertion operator (<<).
 
template<class InputIterator , class UnaryOperation >
auto transform (const InputIterator &first, const InputIterator &last, const UnaryOperation &op)
 Applies a given function to every element of an iterator range and returns the result as a lazily evaluated iterable container (i.e. the "map" function).
 
template<class Container , class UnaryOperation >
auto transform (const Container &c, const UnaryOperation &op)
 Applies a given function to every element of an iterable container and returns the result as a lazily evaluated iterable container (i.e. the "map" function).
 

Variables

const nullopt_t nullopt = nullopt_t()
 A constant that represents a missing value for optional.
 
typedef uint16_t
 16-bit unsigned integer type.
 
typedef uint32_t
 32-bit unsigned integer type.
 
typedef uint64_t
 64-bit unsigned integer type.
 

Detailed Description

Primary namespace.

Typedef Documentation

template<class... Tuples>
using cal::combine_tuples_t = typedef combine_tuples<Tuples...>::type
See Also
combine_tuples
template<class T >
using cal::iterator_type_t = typedef iterator_type<T>::type
See Also
iterator_type
template<class T , class Target >
using cal::match_cv_t = typedef match_cv<T, Target>::type
See Also
match_cv
template<class T , std::size_t N>
using cal::ntuple_t = typedef ntuple<T, N>::type
See Also
ntuple
template<class T >
using cal::unparenthesize_type_t = typedef unparenthesize_type<T>::type
See Also
unparenthesize_type

Function Documentation

template<class... T>
std::string cal::format_str ( const char *  format,
T &&...  t 
)

Returns a formatted string similar to sprintf but without all the hassle of memory management.

Warning: Failing to provide sufficient arguments or arguments of the right type will result in undefined behavior since this function is built on top of snprintf.

template<class Iterator >
counted_iterator<Iterator> cal::iterator_counter ( const Iterator &  iterator,
counted_iterator< Iterator >::difference_type  init_count = counted_iterator<Iterator>::difference_type() 
)
inline

Constructs a counted_iterator with an initial count.

Parameters
iteratorThe iterator to be wrapped.
init_countThe initial count.
See Also
counted_iterator
template<class T >
null_terminated_iterator<T> cal::null_terminated_begin ( T *  ptr)
inline

Returns a ForwardIterator to the first element of a null-terminated array.

Parameters
ptrA pointer to the first element.
See Also
null_terminated_iterator
template<class T >
null_terminated_iterator<T> cal::null_terminated_end ( T *  ptr)
inline

Returns a past-the-end ForwardIterator for a null-terminated array.

Parameters
ptrA pointer to the first element.
See Also
null_terminated_iterator
template<class Container >
auto cal::reverse_range ( const Container &  c)
inline

Reverses a container or iterator range.

Requires rbegin and rend as member functions. This may be relaxed in the future when C++14 support is improved.

template<class T >
std::vector<T> cal::str_to_vector ( const std::basic_string< T > &  s)

Returns a copy of the given string as a vector of characters.

This function can be used to obtain a copy of the string's character buffer.