General Utility Library for C++14  2.11
Classes | Namespaces | Macros | Typedefs | Functions
traits.h File Reference

Detailed Description

Some metaprogramming traits for the General Utility Library.

Authors
General Utility Library Contributors, Michael Park
Date
Created on 20 August 2021

Copyright 2015-2017 Michael Park (implementations of invoke, invoke_result, invoke_result_t, is_invocable, is_invocable_r), copyright 2021-2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg (other implementations and modifications)

Distributed under the Boost Software License, Version 1.0. (See Boost Software License - Version 1.0 or http://boost.org/LICENSE_1_0.txt)

#include <functional>
#include <type_traits>
#include <utility>
#include "gul14/internal.h"
Include dependency graph for traits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gul14::IsContainerLike< T, typename >
 Helper type trait object to determine if a type is a container. More...
 

Namespaces

 gul14
 Namespace gul14 contains all functions and classes of the General Utility Library.
 

Macros

#define GUL14_INVOKE_RETURN(...)    noexcept(noexcept(__VA_ARGS__)) -> decltype(__VA_ARGS__) { return __VA_ARGS__; }
 

Typedefs

template<typename T >
using gul14::remove_cvref = typename std::remove_cv< std::remove_reference_t< T > >
 A template metafunction that removes const, volatile, and reference qualifiers from a type. More...
 
template<typename T >
using gul14::remove_cvref_t = typename remove_cvref< T >::type
 A template metafunction that removes const, volatile, and reference qualifiers from a type. More...
 
template<typename... >
using gul14::void_t = void
 A type mapping an arbitrary list of types to void (for SFINAE). More...
 
template<typename F , typename... Args>
using gul14::invoke_result = detail_invoke_result::invoke_result< void, F, Args... >
 A metafunction that computes the result of invoking a callable object of type F with the given arguments. More...
 
template<typename F , typename... Args>
using gul14::invoke_result_t = typename invoke_result< F, Args... >::type
 A shortcut for invoke_result<...>::type. More...
 
template<typename F , typename... Args>
using gul14::is_invocable = detail_invocable::is_invocable< void, F, Args... >
 A type trait that checks whether a callable object of type F can be invoked with the given arguments. More...
 
template<typename R , typename F , typename... Args>
using gul14::is_invocable_r = detail_invocable::is_invocable_r< void, R, F, Args... >
 A type trait that checks whether a callable object of type F can be invoked with the given arguments and returns a result convertible to R. More...
 

Functions

template<typename F , typename... Args>
constexpr auto gul14::invoke (F &&f, Args &&... args) noexcept(noexcept(detail_invoke::invoke(std::forward< F >(f), std::forward< Args >(args)...))) -> decltype(detail_invoke::invoke(std::forward< F >(f), std::forward< Args >(args)...))
 Invoke a callable object f with the given arguments. More...