WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
utility.hpp File Reference
#include <type_traits>
#include "../config.hpp"

Go to the source code of this file.

Classes

struct  wpi::memory::detail::is_instantiation_of< Template, T >
 
struct  wpi::memory::detail::is_instantiation_of< Template, Template< Args... > >
 

Namespaces

namespace  wpi
 Foonathan namespace.
 
namespace  wpi::memory
 Memory namespace.
 
namespace  wpi::memory::detail
 
namespace  wpi::memory::detail::swap_
 

Macros

#define WPI_REQUIRES(Expr)
 
#define WPI_REQUIRES_RET(Expr, ...)
 
#define WPI_ENABLE_IF(Expr)
 
#define WPI_SFINAE(Expr)
 
#define WPI_AUTO_RETURN(Expr)
 
#define WPI_AUTO_RETURN_TYPE(Expr, T)
 

Functions

template<typename T >
std::remove_reference< T >::type && wpi::memory::detail::move (T &&arg) noexcept
 
template<class T >
T && wpi::memory::detail::forward (typename std::remove_reference< T >::type &t) noexcept
 
template<class T >
T && wpi::memory::detail::forward (typename std::remove_reference< T >::type &&t) noexcept
 
template<typename T >
void wpi::memory::detail::swap_::swap (T &a, T &b)
 
template<typename T >
void wpi::memory::detail::adl_swap (T &a, T &b) noexcept
 

Macro Definition Documentation

◆ WPI_AUTO_RETURN

#define WPI_AUTO_RETURN ( Expr)
Value:
decltype(Expr) \
{ \
return Expr; \
}

◆ WPI_AUTO_RETURN_TYPE

#define WPI_AUTO_RETURN_TYPE ( Expr,
T )
Value:
decltype(Expr) \
{ \
static_assert(std::is_same<decltype(Expr), T>::value, \
#Expr " does not have the return type " #T); \
return Expr; \
}

◆ WPI_ENABLE_IF

#define WPI_ENABLE_IF ( Expr)
Value:
template <typename Dummy = std::true_type, WPI_REQUIRES(Dummy::value && (Expr))>

◆ WPI_REQUIRES

#define WPI_REQUIRES ( Expr)
Value:
typename std::enable_if<(Expr), int>::type = 0

◆ WPI_REQUIRES_RET

#define WPI_REQUIRES_RET ( Expr,
... )
Value:
typename std::enable_if<(Expr), __VA_ARGS__>::type

◆ WPI_SFINAE

#define WPI_SFINAE ( Expr)
Value:
decltype((Expr), int()) = 0