WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
PointerUnion.hpp File Reference

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

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

Go to the source code of this file.

Classes

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

Namespaces

namespace  wpi
namespace  wpi::util
namespace  wpi::util::detail
 These are wrappers over isa* function that allow them to be used in generic algorithms such as wpi::util:all_of, wpi::util::none_of, etc.
namespace  wpi::util::pointer_union_detail

Typedefs

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

Functions

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

Detailed Description

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