|
cxxomfort
rel.20210622
Simple backports for C++ - http://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
Backports made available by cxxomfort. More...
Classes | |
| struct | array |
| C++11 array class. More... | |
| class | basic_string_view |
Read-only view of a string or string-like object, from C++17. See also string/basic_string_view @ cppreference . More... | |
| class | bool_constant |
A bool compile time equivalent of integral_constant , as per C++17. More... | |
| struct | byte |
Implements the backport for std::byte. More... | |
| struct | default_delete |
| struct | index_sequence |
Integer sequence of size_t. More... | |
| struct | integer_sequence |
| C++14 integer_sequence utility. More... | |
| struct | make_index_sequence |
| struct | make_integer_sequence |
| struct | make_void |
Metaprogramming helper that exposes void as a type, for transformations. More... | |
| struct | pointer_traits |
| API to refer to properties of pointer types. More... | |
| struct | reference_wrapper |
| std::reference_wrapper<T> implementation More... | |
| struct | timespec |
| Struct timespec, from POSIX / C++17. More... | |
| class | tuple |
| std::tuple<T...> implementation More... | |
| class | type_index |
| class | unique_ptr |
| unique_ptr: a scoped, movable smart pointer. Emulation of the unique_ptr implementation in C++11 for C++03 compilers. Original backport by Howard Hinnant. More... | |
Typedefs | |
| typedef basic_string_view< char, std::char_traits< char > > | string_view |
Name for a strng view of char . | |
| typedef basic_string_view< wchar_t, std::char_traits< wchar_t > > | wstring_view |
Name for a string view of wchar_t . | |
Functions | |
| template<typename InpI , typename OutI , typename Predicate > | |
| OutI | copy_if (InpI ini, InpI fin, OutI dest, Predicate f) |
| Copy elements conditionally to dest if they fulfill f . More... | |
| template<typename InpI , typename Integral , typename OutI > | |
| OutI | copy_n (InpI ini, Integral n, OutI dest) |
| Copy a given amount of elements to dest . More... | |
| template<typename InpI , typename OutI1 , typename OutI2 , typename Predicate > | |
| std::pair< OutI1, OutI2 > | partition_copy (InpI ini, InpI const fin, OutI1 Dtrue, OutI2 Dfalse, Predicate f) |
Conditionally copy from sequence [ini,fin) to either sequence starting at Dtrue or Dfalsef . More... | |
| template<class It , class Pred > | |
| CXXO_CONSTEXPR14 It | find_if (It ini, It fin, Pred f) |
| Finds an element in a sequence that matches a predicate. More... | |
| template<class It , class Pred > | |
| CXXO_CONSTEXPR14 It | find_if_not (It ini, It fin, Pred f) |
Finds like find_if but the predicate is reversed. More... | |
| template<class It , class Pred > | |
| CXXO_CONSTEXPR14 std::iterator_traits< It >::difference_type | count_if (It ini, It fin, Pred p) |
| Counts the number of times in a sequence the criteria p is matched. More... | |
| template<class It , typename T > | |
| CXXO_CONSTEXPR14 std::iterator_traits< It >::difference_type | count (It ini, It fin, T const &tv) |
| Counts the number of times in a sequence a given value is found. More... | |
| template<typename It , typename Numeric , typename T > | |
| CXXO_CONSTEXPR14 void | fill_n (It ini, Numeric n, T const &tv) |
| Fills a sequence with a given value. More... | |
| template<typename Iterator , typename Compare > | |
| bool | is_sorted (Iterator ini, Iterator fin, Compare less) |
| Determines if a sequence is sorted according to a given criteria. More... | |
| template<typename Iterator > | |
| bool | is_sorted (Iterator ini, Iterator fin) |
| template<class RAIterator , class URNG > | |
| void | shuffle (RAIterator ini, RAIterator fin, URNG &g) |
| Shuffles a sequence according to a generator call g(). More... | |
| template<class II , class Size , class UnaryFunction > | |
| II | for_each_n (II first, Size n, UnaryFunction f) |
| Executes a function once for each element in a sequence, using it as an argument. More... | |
| template<typename U > | |
| constexpr U | bit_width (U u) noexcept |
| template<typename U > | |
| constexpr U | bit_floor (U u) noexcept |
| template<typename U > | |
| constexpr U | bit_ceil (U u) noexcept |
| static int | timespec_get (struct timespec *ts, int base) |
| Returns timespec information from the system clock and writes it into ts . More... | |
| template<typename T > | |
| reference_wrapper< T > | ref (T &t) CXXO_NOEXCEPTNOTHROW |
Wraps an object in a reference_wrapper . More... | |
| template<typename T > | |
| reference_wrapper< T const > | cref (T const &t) CXXO_NOEXCEPTNOTHROW |
Wraps an object in a reference_wrapper to const . More... | |
| template<typename T > | |
| T * | addressof (T &arg) |
| Returns the address of an object. More... | |
| template<typename It1 , typename ItA > | |
| bool | is_permutation (It1 ini1, It1 fin1, ItA iniA) |
| Returns true if range [iniA,finA] (with internally calculated finA) is a permutation of range [ini1,fin1). More... | |
| template<typename BidirIt , typename Compare > | |
| bool | next_permutation (BidirIt ini, BidirIt fin, Compare Less) |
| template<typename BidirIt , typename Compare > | |
| bool | prev_permutation (BidirIt ini, BidirIt fin, Compare less) |
| template<typename NativeType > | |
| std::string | to_string (NativeType) |
Converts an integral variable into a std::string . More... | |
| static std::string | to_string (unsigned int u) |
| static std::string | to_string (short i) |
| static std::string | to_string (unsigned short u) |
| static std::string | to_string (long long i) |
| static std::string | to_string (unsigned long long u) |
| static std::string | to_string (long i) |
| static std::string | to_string (unsigned long u) |
| static std::string | to_string (float i) |
| static std::string | to_string (double i) |
| static std::string | to_string (long double i) |
| static unsigned long | stoul (std::string const &str, size_t *pinv, int base=10) |
Converts a string expression to a unsigned long. More... | |
| static unsigned long long | stoull (std::string const &str, size_t *pinv, int base=10) |
Converts a string expression to a unsigned long long. More... | |
| static signed long | stol (std::string const &str, size_t *pinv, int base=10) |
Converts a string expression to a long. More... | |
| static signed long long | stoll (std::string const &str, size_t *pinv, int base=10) |
Converts a string expression to a long long. More... | |
| template<typename RangeIt1 , typename RangeIt2 , typename Compare > | |
| bool | equal (RangeIt1 ini1, RangeIt1 fin1, RangeIt2 ini2, RangeIt2 fin2, Compare eq) |
Compare two sequences [ini1,fin1) and [ini2,fin2) for equality given comparator eq . Four-iterators overload. More... | |
| template<typename RangeIt1 , typename RangeIt2 > | |
| bool | equal (RangeIt1 ini1, RangeIt1 fin1, RangeIt2 ini2, RangeIt2 fin2) |
| template<class InputIt1 , class InputIt2 , class BinaryPredicate > | |
| std::pair< InputIt1, InputIt2 > | mismatch (InputIt1 ini1, InputIt1 fin1, InputIt2 ini2, InputIt2 fin2, BinaryPredicate p) |
Finds the first difference (dif1,dif2) between two sequences [ini1,fin1) and [ini2,fin2), given comparator eq . Four-iterator overload. More... | |
| template<class InputIt1 , class InputIt2 > | |
| std::pair< InputIt1, InputIt2 > | mismatch (InputIt1 ini1, InputIt1 fin1, InputIt2 ini2, InputIt2 fin2) |
| template<typename T , typename ... Args> | |
| std::unique_ptr< T > | make_unique (Args &&... args) |
| Creates a unique_ptr holding a constructed object. More... | |
| template<typename T , typename... TupleArgs> | |
| T & | get (std::tuple< TupleArgs... > &) |
| Return a member of a tuple given its type as a template argument. More... | |
| template<typename T , typename... TupleArgs> | |
| T const & | get (std::tuple< TupleArgs... > const &) |
| template<typename T > | |
| constexpr std::add_const< T >::type & | as_const (T &t) noexcept |
returns a const view of object t . A C++17 Backports . More... | |
| template<typename T > | |
| constexpr std::add_const< T >::type * | as_ptr_const (T *const t) noexcept |
returns a const view of a pointer t . An extension to as_const() . More... | |
| bool | operator== (byte, byte) |
| Compares the numerical expression of two bytes. | |
| bool | operator!= (byte, byte) |
| Compares the numerical expression of two bytes. | |
| template<typename Integral > | |
| Integral | to_integer (byte b) |
| unsigned char | to_value (byte b) |
Converts the byte value into an unsigned char. | |
| template<class T , class Compare > | |
| constexpr T const & | clamp (T const &val, T const &lo, T const &hi, Compare comp) |
| Clamps a value. More... | |
| template<class T > | |
| CXXO_CONSTEXPR T const & | clamp (T const &val, T const &lo, T const &hi) |
| template<typename F , typename... Args> | |
| dependent_type_t | invoke (F &&f, Args &&... args) |
Invokes a callable. See also invoke_r() . More... | |
| template<typename R , typename F , typename... Args> | |
| R | invoke_r (F &&f, Args &&... args) |
Invokes a callable and specifies a return type. See also invoke() . More... | |
| template<typename C > | |
| C::size_type | size (C &c) |
| Returns the size (number of elements) of a sequence / container expression. More... | |
| template<typename C > | |
| constexpr auto | data (C &container) -> decltype(container.data()) |
| provides access to an internal "<code>.data()</code>" member. More... | |
| template<typename C > | |
| bool | data (C const &container) |
| provides access to an internal "<code>.empty()</code>" member. More... | |
| template<typename C > | |
| bool | empty (C const &c) |
Accesses and returns the .empty() member of the container. More... | |
| template<typename C > | |
| size_t | size (C const &c) |
Accesses and returns the .size() member of the container. More... | |
| template<typename C > | |
| C::pointer | data (C const &c) |
Accesses and returns the .data() member of the container. More... | |
| template<typename T , typename... TupleArgs> | |
| T | make_from_tuple (std::tuple< TupleArgs... > &&Tuple) |
| Create an object from a tuple expression. More... | |
| template<typename F , typename Tuple > | |
| implementation_defined_t | apply (F f, Tuple &t) |
| Applies the tuple t as the arguments to the functionlike / callable f . More... | |
| template<typename Fn , typename... Binds> | |
| implementation_defined_t | bind_front (Fn &&callable, Binds &&... args) |
| Wraps a function and its first n arguments in a callable object. More... | |
| template<typename T , typename U > | |
| T | exchange (T &obj, CXXO_RV_REF(U) nval) |
| Replaces a variable's value, returns the old value. More... | |
| template<typename Fn > | |
| not_fn_t< Fn > | not_fn (Fn &&f) |
| Creates a function wrapper that returns the negation of a given function-like / callable. More... | |
| template<typename It > | |
| CXXO_CONSTEXPR std::reverse_iterator< It > | make_reverse_iterator (It i) |
| Constructs the reverse_iterator for a given iterator. More... | |
| template<typename FwIt , typename T > | |
| FwIt | iota (FwIt ini, FwIt fin, T i0) |
| Fills a sequence with a sequentially growing set of values. "Numeric" iota. More... | |
| template<typename FwIt , typename Integer , typename T > | |
| FwIt | iota_n (FwIt ini, Integer n, T i0) |
| Fills a sequence with a sequentially growing set of values. More... | |
| template<typename Num1 , typename Num2 > | |
| CXXO_CONSTEXPR Num1 | gcd (Num1 n1, Num2 n2) CXXO_NOEXCEPT |
| Calculates the greatest common divisor. More... | |
| template<typename Num1 , typename Num2 > | |
| CXXO_CONSTEXPR Num1 | lcm (Num1 n1, Num2 n2) CXXO_NOEXCEPT |
| Calculates the lowest common multiple. More... | |
| template<typename T > | |
| T & | declval () |
| Expression for an unevaluated context. "Type Utilities" declval. More... | |
| template<size_t I, typename T , size_t N> | |
| T & | get (array< T, N > &a) CXXO_NOEXCEPTNOTHROW |
Tuple-like interface to access an element in an array . More... | |
| template<size_t I, typename T , size_t N> | |
| T const & | get (array< T, N > const &a) CXXO_NOEXCEPTNOTHROW |
| template<typename Iter , typename Predicate > | |
| bool | all_of (Iter ini, Iter fin, Predicate f) |
| Checks if all elements of a sequence fit a given predicate. More... | |
| template<typename Iter , typename Predicate > | |
| bool | any_of (Iter ini, Iter fin, Predicate f) |
| Checks if any one element of a sequence fit a given predicate. More... | |
| template<typename Iter , typename Predicate > | |
| bool | none_of (Iter ini, Iter fin, Predicate f) |
| Checks if no elements of a sequence fit a given predicate. More... | |
| template<typename T , typename Comparator > | |
| std::pair< T const &, T const & > | minmax (T const &a, T const &b, Comparator Less) |
Return a pair(min,max) from two arguments and a comparator Less . More... | |
| template<typename T > | |
| std::pair< T const &, T const & > | minmax (T const &a, T const &b) |
| template<typename FIterator , typename Comparator > | |
| std::pair< FIterator, FIterator > | minmax_element (FIterator ini, FIterator fin, Comparator less) |
Returns the pair (minimum,maximum) for the given sequence and comparator less . More... | |
| template<typename FIterator > | |
| std::pair< FIterator, FIterator > | minmax_element (FIterator ini, FIterator fin) |
| template<typename T > | |
| void | destroy_at (T *p) CXXO_NOEXCEPTNOTHROW |
Destructs an object, as if the destructor was invoked via Type::~Type(). More... | |
| template<typename Iter , typename Iter2 > | |
| void | destroy (Iter ini, Iter2 fin) |
| Destructs a sequence of objects. More... | |
| template<typename Iter , typename Integer > | |
| void | destroy_n (Iter ini, Integer n) |
| Destructs a sequence of objects. More... | |
| template<typename It > | |
| void | uninitialized_default_construct (It ini, It fin) |
| Default-constructs objects in uninitialized memory. More... | |
| template<typename It , typename Integer > | |
| void | uninitialized_default_construct_n (It ini, Integer n) |
| Default-constructs objects in uninitialized memory. More... | |
Backports made available by cxxomfort.
Namespace that holds the library's backports of named C++ features.
| OutI cxxomfort::cxxostd::copy_if | ( | InpI | ini, |
| InpI | fin, | ||
| OutI | dest, | ||
| Predicate | f | ||
| ) |
Copy elements conditionally to dest if they fulfill f .
| f | A predicate that maps Inp::value_type -> bool. |
Given the sequence [ini, fin), copies those elements e inside it to dest for which the evlauation f(e) is true .
|
inline |
Copy a given amount of elements to dest .
Copies n elements from ini to , unconditionally.
Referenced by array_ref< Ch const >::back(), and cxxomfort::library::algorithm::copy_leftmost_n().
| std::pair<OutI1,OutI2> cxxomfort::cxxostd::partition_copy | ( | InpI | ini, |
| InpI const | fin, | ||
| OutI1 | Dtrue, | ||
| OutI2 | Dfalse, | ||
| Predicate | f | ||
| ) |
Conditionally copy from sequence [ini,fin) to either sequence starting at Dtrue or Dfalsef .
| f | A predicate that maps InpI::value_type -> bool. |
std::pair (Dtrue , Dfalse ). This algorithm is a variation of copy_if() . Where copy_if copies to one destination dest if the condition is true , partition_copy() copies elements e in [ini,fin) to either Dtrue or Dfalse depending on the return value of f(e).
| CXXO_CONSTEXPR14 It cxxomfort::cxxostd::find_if | ( | It | ini, |
| It | fin, | ||
| Pred | f | ||
| ) |
Finds an element in a sequence that matches a predicate.
| f | A predicate that maps It::value_type -> bool. |
constexpr starting C++20; here it is tentatively marked constexpr for C++14 as well. We can't modify the C++17 version. Referenced by cxxomfort::library::algorithm::find(), and cxxomfort::library::algorithm::find_if_not().
| CXXO_CONSTEXPR14 It cxxomfort::cxxostd::find_if_not | ( | It | ini, |
| It | fin, | ||
| Pred | f | ||
| ) |
Finds like find_if but the predicate is reversed.
| f | A predicate that maps It::value_type -> bool. |
constexpr starting C++20; here it is tentatively marked constexpr for C++14 as well. We can't modify the C++17 version. | CXXO_CONSTEXPR14 std::iterator_traits<It>::difference_type cxxomfort::cxxostd::count_if | ( | It | ini, |
| It | fin, | ||
| Pred | p | ||
| ) |
Counts the number of times in a sequence the criteria p is matched.
| f | A predicate that maps It::value_type -> bool. |
constexpr starting C++20; here it is tentatively marked constexpr for C++14 as well. We can't modify the C++17 version. | CXXO_CONSTEXPR14 std::iterator_traits<It>::difference_type cxxomfort::cxxostd::count | ( | It | ini, |
| It | fin, | ||
| T const & | tv | ||
| ) |
Counts the number of times in a sequence a given value is found.
constexpr starting C++20; here it is tentatively markes constexpr for C++14 as well. We can't modify the C++17 version. Referenced by array_ref< Ch const >::back(), is_permutation(), basic_string_view< Ch, ChT >::length(), and array_ref< Ch const >::rightmost().
| CXXO_CONSTEXPR14 void cxxomfort::cxxostd::fill_n | ( | It | ini, |
| Numeric | n, | ||
| T const & | tv | ||
| ) |
Fills a sequence with a given value.
| n | How many elements to fill. |
| tv | The value to use to fill. |
|
inline |
Determines if a sequence is sorted according to a given criteria.
| less | Criteria for sorting, a binary function f(x,y) that returns true if x<y. |
Referenced by is_sorted().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void cxxomfort::cxxostd::shuffle | ( | RAIterator | ini, |
| RAIterator | fin, | ||
| URNG & | g | ||
| ) |
Shuffles a sequence according to a generator call g().
| g | A writable object that acts like a (P)RNG and returns a value via operator(). |
| II cxxomfort::cxxostd::for_each_n | ( | II | first, |
| Size | n, | ||
| UnaryFunction | f | ||
| ) |
Executes a function once for each element in a sequence, using it as an argument.
| f | A function that takes arguments and can modify them. |
| f | A function object that is executed as f(i) for each i in the sequence. |
accumulate() .
|
noexcept |
Returns the number of bits required to represent the value of u .
std::is_unsigned<U>::value
|
noexcept |
Returns u rounded down to a power of 2.
std::is_unsigned<U>::value
|
noexcept |
Returns u rounded up to a power of 2.
std::is_unsigned<U>::value
|
inlinestatic |
Returns timespec information from the system clock and writes it into ts .
timespec_get() . | T& cxxomfort::cxxostd::get | ( | array< T, N > & | a | ) |
Tuple-like interface to access an element in an array .
| I | Index to be accessed. |
| T const& cxxomfort::cxxostd::get | ( | array< T, N > const & | a | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| reference_wrapper<T> cxxomfort::cxxostd::ref | ( | T & | t | ) |
Wraps an object in a reference_wrapper .
reference_wrapper<T> holding the named object t . reference_wrapper | reference_wrapper<T const> cxxomfort::cxxostd::cref | ( | T const & | t | ) |
Wraps an object in a reference_wrapper to const .
reference_wrapper<T const> holding the named object t . reference_wrapper
|
inline |
Returns the address of an object.
Referenced by destroy(), destroy_n(), uninitialized_default_construct(), and uninitialized_default_construct_n().
| bool cxxomfort::cxxostd::all_of | ( | Iter | ini, |
| Iter | fin, | ||
| Predicate | f | ||
| ) |
Checks if all elements of a sequence fit a given predicate.
true if for all elements e in [ini,fin), f(e) == true. Referenced by none_of().
| bool cxxomfort::cxxostd::any_of | ( | Iter | ini, |
| Iter | fin, | ||
| Predicate | f | ||
| ) |
Checks if any one element of a sequence fit a given predicate.
true if for at least one elements e in [ini,fin), f(e) == true. Referenced by none_of().
| bool cxxomfort::cxxostd::none_of | ( | Iter | ini, |
| Iter | fin, | ||
| Predicate | f | ||
| ) |
Checks if no elements of a sequence fit a given predicate.
true if for no elements e in [ini,fin), f(e) == true. | std::pair<T const&, T const&> cxxomfort::cxxostd::minmax | ( | T const & | a, |
| T const & | b, | ||
| Comparator | Less | ||
| ) |
Return a pair(min,max) from two arguments and a comparator Less .
pair (min, max) Referenced by minmax_element().
| std::pair<T const&, T const&> cxxomfort::cxxostd::minmax | ( | T const & | a, |
| T const & | b | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Referenced by minmax_element().
| std::pair<FIterator,FIterator> cxxomfort::cxxostd::minmax_element | ( | FIterator | ini, |
| FIterator | fin, | ||
| Comparator | less | ||
| ) |
Returns the pair (minimum,maximum) for the given sequence and comparator less .
| less | A comparator object with the same semantics as std::less . |
std::pair containing the minimum and maximum. Referenced by minmax_element().
| std::pair<FIterator,FIterator> cxxomfort::cxxostd::minmax_element | ( | FIterator | ini, |
| FIterator | fin | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| bool cxxomfort::cxxostd::is_permutation | ( | It1 | ini1, |
| It1 | fin1, | ||
| ItA | iniA | ||
| ) |
Returns true if range [iniA,finA] (with internally calculated finA) is a permutation of range [ini1,fin1).
Source: cppreference.comReferenced by prev_permutation().
| bool cxxomfort::cxxostd::next_permutation | ( | BidirIt | ini, |
| BidirIt | fin, | ||
| Compare | Less | ||
| ) |
Shuffles the sequence to become the next_permutation
| bool cxxomfort::cxxostd::prev_permutation | ( | BidirIt | ini, |
| BidirIt | fin, | ||
| Compare | less | ||
| ) |
Shuffles the sequence to become the previous permutation
| std::string cxxomfort::cxxostd::to_string | ( | NativeType | ) |
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Referenced by stoll().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Converts a string expression to a long long.
| base | Base to convert from, which can be 2, 8, 10 (default) or 16. |
|
inline |
Compare two sequences [ini1,fin1) and [ini2,fin2) for equality given comparator eq . Four-iterators overload.
| [in] | ini1,fin1 | Delimiters for the first sequence argument to compare. |
| [in] | ini2,fin2 | Delimiters for the second sequence argument to compare. |
| eq | An equality compare object. |
true if both ranges have equal elements. Referenced by mismatch().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| std::pair<InputIt1, InputIt2> cxxomfort::cxxostd::mismatch | ( | InputIt1 | ini1, |
| InputIt1 | fin1, | ||
| InputIt2 | ini2, | ||
| InputIt2 | fin2, | ||
| BinaryPredicate | p | ||
| ) |
Finds the first difference (dif1,dif2) between two sequences [ini1,fin1) and [ini2,fin2), given comparator eq . Four-iterator overload.
| p | An equality compare object. |
Referenced by is_permutation(), and mismatch().
| std::pair<InputIt1, InputIt2> cxxomfort::cxxostd::mismatch | ( | InputIt1 | ini1, |
| InputIt1 | fin1, | ||
| InputIt2 | ini2, | ||
| InputIt2 | fin2 | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Creates a unique_ptr holding a constructed object.
| T& cxxomfort::cxxostd::get | ( | std::tuple< TupleArgs... > & | ) |
Return a member of a tuple given its type as a template argument.
Given a std::tuple type with component types TupleArgs... , the new C++14 overload of std::get() is provided that gives access to the element of type T in the tuple, assuming there is one element in TupleArgs with type T .
CXXOMFORT_IMPLEMENTS_tuple_get_type notifies if this function can be enabled. | T const& cxxomfort::cxxostd::get | ( | std::tuple< TupleArgs... > const & | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlinenoexcept |
returns a const view of object t . A C++17 Backports .
const qualifier added.Referenced by as_ptr_const().
|
inlinenoexcept |
returns a const view of a pointer t . An extension to as_const() .
| Integral cxxomfort::cxxostd::to_integer | ( | byte | b | ) |
Converts the byte value into an Integral .
| constexpr T const & clamp | ( | T const & | val, |
| T const & | lo, | ||
| T const & | hi, | ||
| Compare | comp | ||
| ) |
Clamps a value.
hi < lo.constexpr functions can not perform assert or throw checks in their code. As such in C++11, while clamp() is constexpr it has no precondition checks. Referenced by clamp(), and cxxomfort::library::algorithm::is_clamped().
| CXXO_CONSTEXPR T const& cxxomfort::cxxostd::clamp | ( | T const & | val, |
| T const & | lo, | ||
| T const & | hi | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| dependent_type_t cxxomfort::cxxostd::invoke | ( | F && | f, |
| Args &&... | args | ||
| ) |
Invokes a callable. See also invoke_r() .
invoke(callable, args...) invoke() calls a functionlike or callable f with the given arguments args... , taking care of forwarding, member function pointers, etc.
invoke(f, 1, 2, 3, ...) is in general equivalent to f(1, 2, 3, ...).
With member functions, invoke(C::f, a, b, c, ...) is in general equivalent to a.f(b, c, ...).
The invoke() feature is backported down to C++11 with full support, and down to C++03 with partial support.
invoke() may not necessarily be constexpr .invoke() is partially supported; in particular, invoke() is mostly / only supported for compilers that have CXXO_COMPILER_SUPPORT_typeof == true so return type deduction can be provided, and only supports object callables. Compilers without typeof or any other similar measure should be using invoke_r() instead.invoke() only supports object-like callables. To use with eg.: member function pointers, wrap those in mem_fn(), std::function, etc. Referenced by apply(), bind_front(), and invoke_r().
| R cxxomfort::cxxostd::invoke_r | ( | F && | f, |
| Args &&... | args | ||
| ) |
Invokes a callable and specifies a return type. See also invoke() .
invoke(callable, args...) invoke_r() calls a functionlike or callable f with the given arguments args... , taking care of forwarding, member function pointers, and implicitly converts the resulting value to type R during return.
invoke_r<R>(f, 1, 2, 3, ...) is in general equivalent to static_cast<R>(f(1, 2, 3, ...)).
The invoke_r() feature is backported down to C++11 with full support, and down to C++98 with partial support. Unlike invoke() which requires type deduction for return, invoke_r() can be used even in compilers that lack typeof .
invoke_r() may not necessarily be constexpr .invoke_r() only supports object-like callables. To use with eg.: member function pointers, wrap those in mem_fn(), std::function, etc.
|
inline |
Returns the size (number of elements) of a sequence / container expression.
Referenced by array< T, N >::at(), cxxomfort::at_or(), and cxxomfort::atindex_or().
| constexpr auto cxxomfort::cxxostd::data | ( | C & | container | ) | -> decltype(container.data()) |
provides access to an internal "<code>.data()</code>" member.
data(c) invokes c.data() for container for which it exists. The result type is assumed to be a pointer type or equivalent that provides direct access to a contiguous storage.
pointer and const_pointer. | bool cxxomfort::cxxostd::data | ( | C const & | container | ) |
| bool cxxomfort::cxxostd::empty | ( | C const & | c | ) |
Accesses and returns the .empty() member of the container.
.empty() on the container. Referenced by data().
| size_t cxxomfort::cxxostd::size | ( | C const & | c | ) |
| C::pointer cxxomfort::cxxostd::data | ( | C const & | c | ) |
| T cxxomfort::cxxostd::make_from_tuple | ( | std::tuple< TupleArgs... > && | Tuple | ) |
Create an object from a tuple expression.
The call make_from_tuple<T>( footuple ) is equivalent to the call T (get<0>(footuple), get<1>(footuple), get<2>(footuple), ...).
| implementation_defined_t cxxomfort::cxxostd::apply | ( | F | f, |
| Tuple & | t | ||
| ) |
Applies the tuple t as the arguments to the functionlike / callable f .
| f | A callable / function-like argument. |
| t | A std::tuple or similar construct. |
f(t...) returns. Example usage:
Referenced by bind_front().
| implementation_defined_t cxxomfort::cxxostd::bind_front | ( | Fn && | callable, |
| Binds &&... | args | ||
| ) |
Wraps a function and its first n arguments in a callable object.
| args | A sequence of arguments that are bound to the callable. |
Given a callable object or function fn taking n arguments and a sequence args of at most n arguments, bind_front(fn,args...) returns a callable object wf of undetermined type that wraps fn and args such as at a later point of use the invocation wf(call_args...), fn is invoked via invoke() with the lists of arguments args and call_args in sequence.
In other words, bind_front() functions exactly like bind() except that it only binds the first few arguments.
| T cxxomfort::cxxostd::exchange | ( | T & | obj, |
| CXXO_RV_REF(U) | nval | ||
| ) |
Replaces a variable's value, returns the old value.
cxx14-backports
| not_fn_t<Fn> cxxomfort::cxxostd::not_fn | ( | Fn && | f | ) |
Creates a function wrapper that returns the negation of a given function-like / callable.
| f | A function-like callable with operator(). |
nf(args...) == !(f(args...)).| void cxxomfort::cxxostd::destroy_at | ( | T * | p | ) |
Destructs an object, as if the destructor was invoked via Type::~Type().
Referenced by destroy(), destroy_n(), and uninitialized_default_construct_n().
| void cxxomfort::cxxostd::destroy | ( | Iter | ini, |
| Iter2 | fin | ||
| ) |
Destructs a sequence of objects.
Referenced by uninitialized_default_construct(), and uninitialized_default_construct_n().
| void cxxomfort::cxxostd::destroy_n | ( | Iter | ini, |
| Integer | n | ||
| ) |
Destructs a sequence of objects.
Referenced by uninitialized_default_construct_n().
| void cxxomfort::cxxostd::uninitialized_default_construct | ( | It | ini, |
| It | fin | ||
| ) |
Default-constructs objects in uninitialized memory.
| <tt>bad_alloc</tt>. |
| void cxxomfort::cxxostd::uninitialized_default_construct_n | ( | It | ini, |
| Integer | n | ||
| ) |
Default-constructs objects in uninitialized memory.
| <tt>bad_alloc</tt>. |
| CXXO_CONSTEXPR std::reverse_iterator<It> cxxomfort::cxxostd::make_reverse_iterator | ( | It | i | ) |
Constructs the reverse_iterator for a given iterator.
| FwIt cxxomfort::cxxostd::iota | ( | FwIt | ini, |
| FwIt | fin, | ||
| T | i0 | ||
| ) |
Fills a sequence with a sequentially growing set of values. "Numeric" iota.
Given the sequence [ini, fin), iota assigns the values i0, i0+1, i0+2, ... to the elements of the sequence until it has been filled.
[ini, fin) is valid and writable.| FwIt cxxomfort::cxxostd::iota_n | ( | FwIt | ini, |
| Integer | n, | ||
| T | i0 | ||
| ) |
Fills a sequence with a sequentially growing set of values.
Given the sequence starting at ini , iota assigns the values i0, i0+1, i0+2, ... to the n elements of the sequence until the n -th element has been reached.
[ini, ini+n) is valid and writable.| CXXO_CONSTEXPR Num1 cxxomfort::cxxostd::gcd | ( | Num1 | n1, |
| Num2 | n2 | ||
| ) |
Calculates the greatest common divisor.
Referenced by lcm().
| CXXO_CONSTEXPR Num1 cxxomfort::cxxostd::lcm | ( | Num1 | n1, |
| Num2 | n2 | ||
| ) |
Calculates the lowest common multiple.
| T& cxxomfort::cxxostd::declval | ( | ) |
Expression for an unevaluated context. "Type Utilities" declval.
Referenced by invoke_r().
1.8.13