libzed 1.10.2
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
templates.hpp
Go to the documentation of this file.
1
6#include <iterator>
7#include <type_traits>
8
9namespace z {
10namespace core {
11
17template <typename T>
18using dereference = std::remove_const_t<std::remove_reference_t<decltype(*std::declval<decltype(std::declval<T>().begin())>())>>;
19
25template <typename T>
26using iterator_value = std::remove_const_t<decltype(std::declval<T>().begin())>;
27
33template <typename T>
34using const_iterator_value = decltype(std::declval<const T &>().begin());
35
40template <typename T, typename = void>
41struct is_iterator : std::false_type {};
42
47template <typename T>
48struct is_iterator<T, std::void_t<decltype(std::begin(std::declval<T>()))>> : std::true_type {};
49
50} // namespace core
51} // namespace z
A wrapper for std::vector.
Definition array.hpp:75
decltype(std::declval< const T & >().begin()) const_iterator_value
The type of a const iterator from a const reference to a container. This is used when iterating over ...
Definition templates.hpp:34
std::remove_const_t< std::remove_reference_t< decltype(*std::declval< decltype(std::declval< T >().begin())>())> > dereference
The type of the dereferenced value from an iterable. This is used to determine the type of value that...
Definition templates.hpp:18
std::remove_const_t< decltype(std::declval< T >().begin())> iterator_value
The type of the value that an iterator generates. This is used to determine the type of iterator that...
Definition templates.hpp:26
The default specialization for types that are not iterators.
Definition templates.hpp:41