WPILibC++ 2024.3.2
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/Casting.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::CastInfoPointerUnionImpl< PTs >
 We can't (at least, at this moment with C++14) declare CastInfo as a friend of PointerUnion like this: More...
 
struct  wpi::CastInfo< To, PointerUnion< PTs... > >
 
struct  wpi::CastInfo< To, const PointerUnion< PTs... > >
 
struct  wpi::PointerLikeTypeTraits< PointerUnion< PTs... > >
 
struct  wpi::DenseMapInfo< PointerUnion< PTs... > >
 

Namespaces

namespace  wpi
 
namespace  wpi::detail
 
namespace  wpi::pointer_union_detail
 

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.