Range-v3 Range algorithms, views, and actions for the Standard Library |

Modules | Classes | Typedefs | Functions | Variables
Trait
Meta

## Description

Trait invocation/composition.

## Modules
| Invocation
| Trait invocation.
| Composition
| Trait composition.
| lazy

## Classes
struct | meta::id< T >
| A trait that always returns its argument `T`. It is also an invocable that always returns `T`. More...

## Typedefs
template<typename T >
using | meta::alignof_ = meta::size_t< alignof(T)>
| An alias that computes the alignment required for any instance of the type `T`. More...
template<typename T >
using | meta::id_t = _t< id< T > >
| An alias for type `T`. Useful in non-deduced contexts.
template<typename T , template< typename... > class C>
using | meta::is = bool_< is_v< T, C > >
| is Test whether a type `T` is an instantiation of class template `C`.
template<typename T >
using | meta::is_callable = bool_< is_callable_v< T > >
| An alias for `std::true_type` if `T::invoke` exists and names a class template; otherwise, it's an alias for `std::false_type`.
template<typename T >
using | meta::is_trait = bool_< is_trait_v< T > >
| An alias for `std::true_type` if `T::type` exists and names a type; otherwise, it's an alias for `std::false_type`.
template<typename T >
using | meta::is_valid = detail::is_valid_< T >
| For testing whether a deferred computation will succeed in a `let` or a `lambda`.
template<typename... As>
using | meta::let = _t< _t< detail::let_< As... > >>
| A lexically scoped expression with local variables. More...
template<invocable Fn>
using | meta::not_fn = compose< quote< not_ >, Fn >
| Logically negate the result of invocable `Fn`.
template<typename T >
using | meta::sizeof_ = meta::size_t< sizeof(T)>
| An alias that computes the size of the type `T`. More...
template<typename... >
using | meta::void_ = void
| An alias for `void`.

## Functions
template<typename... Ts>
| meta::requires (sizeof...(Ts) > 0) using lambda
| For creating anonymous Invocables. More...

## Variables
template<typename T >
constexpr bool | meta::is_callable_v = invocable<T>
| `true` if `T::invoke` exists and names a class template; `false` otherwise.
template<typename T >
constexpr bool | meta::is_trait_v = trait<T>
| `true` if `T::type` exists and names a type; `false` otherwise.
template<typename , template< typename... > class>
constexpr bool | meta::is_v = false
| is_v Test whether a type `T` is an instantiation of class template `C`.

## Typedef Documentation

## ◆ alignof_

template<typename T >

using meta::alignof_ = typedef meta::size_t<alignof(T)>

`#include <meta/meta.hpp>`

An alias that computes the alignment required for any instance of the type `T`.

Complexity
  .

## ◆ let

template<typename... As>

using meta::let = typedef _t<_t<detail::let_<As...> >>

`#include <meta/meta.hpp>`

A lexically scoped expression with local variables.

template <typename T, typename L>
using find_index_ = let<
var<_a, L>,
var<_b, lazy::find<_a, T>>,
lazy::if_<
std::is_same<_b, list<>>,
meta::npos,
lazy::minus<lazy::size<_a>, lazy::size<_b>>>>;
static_assert(find_index_<int, list<short, int, float>>{} == 1, "");
static_assert(find_index_<double, list<short, int, float>>{} == meta::npos{}, "");

## ◆ sizeof_

template<typename T >

using meta::sizeof_ = typedef meta::size_t<sizeof(T)>

`#include <meta/meta.hpp>`

An alias that computes the size of the type `T`.

Complexity
  .

## Function Documentation

## ◆ requires()

template<typename... Ts>

meta::requires | ( | sizeof... | Ts,
|  | 0 |
| ) |  |

`#include <meta/meta.hpp>`

For creating anonymous Invocables.

using L = lambda<_a, _b, std::pair<_b, std::pair<_a, _a>>>;
using P = invoke<L, int, short>;
static_assert(std::is_same_v<P, std::pair<short, std::pair<int, int>>>, "");
meta::pair
list< F, S > pair
A list with exactly two elements.
Definition: meta.hpp:1839
meta::npos
meta::size_t< std::size_t(-1)> npos
A special value used to indicate no matches. It equals the maximum value representable by std::size_t...
Definition: meta.hpp:1300
meta::lazy::if_
defer< if_, Args... > if_
Definition: meta.hpp:994
meta::let
_t< _t< detail::let_< As... > >> let
A lexically scoped expression with local variables.
Definition: meta.hpp:3105