WPILibC++ 2023.4.3-108-ge5452e3
PointerUnion.h File Reference

This file defines the PointerUnion class, which is a discriminated union of pointer types. More...

#include "wpi/DenseMapInfo.h"
#include "wpi/PointerIntPair.h"
#include "wpi/PointerLikeTypeTraits.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <type_traits>

Go to the source code of this file.

Classes

struct  wpi::detail::TypesAreDistinct< T, Us >
 
struct  wpi::detail::TypesAreDistinct< T >
 
struct  wpi::TypesAreDistinct<>
 
struct  wpi::TypesAreDistinct< Ts >
 Determine if all types in Ts are distinct. More...
 
struct  wpi::FirstIndexOfType< T, U, Us... >
 
struct  wpi::FirstIndexOfType< T, T, Us... >
 
struct  wpi::pointer_union_detail::GetFirstType< T,... >
 Find the first type in a list of types. More...
 
class  wpi::pointer_union_detail::PointerUnionUIntTraits< PTs >
 Provide PointerLikeTypeTraits for void* that is used by PointerUnion for the template arguments. More...
 
class  wpi::pointer_union_detail::PointerUnionMembers< Derived, ValTy, I >
 
class  wpi::pointer_union_detail::PointerUnionMembers< Derived, ValTy, I, Type, Types... >
 
class  wpi::PointerUnion< PTs >
 A discriminated union of two or more pointer types, with the discriminator in the low bit of the pointer. More...
 
struct  wpi::PointerLikeTypeTraits< PointerUnion< PTs... > >
 
struct  wpi::DenseMapInfo< PointerUnion< PTs... > >
 

Namespaces

namespace  wpi
 
namespace  wpi::detail
 detail namespace with internal helper functions
 
namespace  wpi::pointer_union_detail
 

Typedefs

template<size_t I, typename... Ts>
using wpi::TypeAtIndex = std::tuple_element_t< I, std::tuple< Ts... > >
 Find the type at a given index in a list of types. More...
 

Functions

constexpr int wpi::pointer_union_detail::bitsRequired (unsigned n)
 Determine the number of bits required to store integers with values < n. More...
 
template<typename... Ts>
constexpr int wpi::pointer_union_detail::lowBitsAvailable ()
 
template<typename ... PTs>
bool wpi::operator== (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<typename ... PTs>
bool wpi::operator!= (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<typename ... PTs>
bool wpi::operator< (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 

Detailed Description

This file defines the PointerUnion class, which is a discriminated union of pointer types.