|
conststr 0.2.1
|
Some useful template meta. More...
Concepts | |
| concept | all_same |
This concept is satisfied if all types of Ts... the same type. | |
| concept | all_same_of |
This concept is satisfied if all values of Vs... has the same type. | |
| concept | hashable |
This concept is satisfied if std::hash<T> has specialization. | |
| concept | viewer |
This concept is satisfied if T is a view type to a constant contiguous sequence of Elem. | |
Typedefs | |
| template<typename... Ts> | |
| using | first_t = std::tuple_element_t< 0, std::tuple< Ts... > > |
| Get the first type of class template parameter pack. More... | |
| template<auto... Vs> | |
| using | first_t_of = std::remove_cvref_t< std::tuple_element_t< 0, decltype(std::tuple{Vs...})> > |
| Get the type of the first value of variable template parameter pack. More... | |
| template<typename... Ts> | |
| using | last_t = std::tuple_element_t< sizeof...(Ts) - 1, std::tuple< Ts... > > |
| Get the last type of class template parameter pack. More... | |
| template<auto... Vs> | |
| using | last_t_of = std::remove_cvref_t< std::tuple_element_t< sizeof...(Vs) - 1, decltype(std::tuple{Vs...})> > |
| Get the type of the last value of variable template parameter pack. More... | |
Variables | |
| template<auto... Vs> | |
| constexpr auto | first_v = [](auto first, auto...) { return first; }(Vs...) |
| Get the first value of variable template parameter pack. More... | |
| template<auto... Vs> | |
| constexpr auto | last_v = (Vs, ...) |
| Get the last value of variable template parameter pack. More... | |
Some useful template meta.
| using conststr::meta::first_t = typedef std::tuple_element_t<0, std::tuple<Ts...> > |
Get the first type of class template parameter pack.
For example, first_t<T, U, V, W> is T.
| Ts | the class template parameter pack |
| using conststr::meta::first_t_of = typedef std::remove_cvref_t<std::tuple_element_t<0, decltype(std::tuple{Vs...})> > |
Get the type of the first value of variable template parameter pack.
For example, first_t_of<a, b, c, d> is decltype(a).
| Vs | the variable template parameter pack |
| using conststr::meta::last_t = typedef std::tuple_element_t<sizeof...(Ts) - 1, std::tuple<Ts...> > |
Get the last type of class template parameter pack.
For example, first_t<T, U, V, W> is W.
| Ts | the class template parameter pack |
| using conststr::meta::last_t_of = typedef std::remove_cvref_t< std::tuple_element_t<sizeof...(Vs) - 1, decltype(std::tuple{Vs...})> > |
Get the type of the last value of variable template parameter pack.
For example, first_t_of<a, b, c, d> is decltype(d).
| Vs | the variable template parameter pack |
|
constexpr |
Get the first value of variable template parameter pack.
For example, first_v<a, b, c, d> is a.
| Vs | the variable template parameter pack |
|
constexpr |
Get the last value of variable template parameter pack.
For example, first_v<a, b, c, d> is d.
| Vs | the variable template parameter pack |