codex
Loading...
Searching...
No Matches
storage_switch.cpp File Reference
#include <algorithm>
#include <array>
#include <iostream>
#include <ranges>
#include <span>
#include <utility>
Include dependency graph for storage_switch.cpp:

Classes

struct  detail::entry
 
class  storage_switch< N >
 

Namespaces

namespace  detail
 

Macros

#define FWD(x)   std::forward<decltype(x)>(x)
 
#define X(x)   template<> const char *type_name<x> = #x;
 

Typedefs

template<typename R , typename T >
using detail::same_constness = std::conditional_t<std::is_const_v<R>, const T, T>
 

Functions

constexpr bool detail::contains (const std::ranges::contiguous_range auto &r, const auto &x)
 
template<typename T >
auto detail::find (std::span< const entry > s, T *p)
 
template<typename T >
void detail::call (T *p, void *d, std::span< const entry > s)
 
template<auto f, std::ranges::contiguous_range ... Rs>
auto make_storage_switch (void *d, Rs &&...rs)
 
 X (int) X(unsigned) X(float) int main(void)
 

Variables

template<typename >
const char * type_name
 

Macro Definition Documentation

◆ FWD

#define FWD ( x)    std::forward<decltype(x)>(x)

◆ X

#define X ( x)    template<> const char *type_name<x> = #x;

Function Documentation

◆ make_storage_switch()

template<auto f, std::ranges::contiguous_range ... Rs>
auto make_storage_switch ( void * d,
Rs &&... rs )
Here is the caller graph for this function:

◆ X()

X ( int )
Here is the call graph for this function:

Variable Documentation

◆ type_name

template<typename >
const char* type_name