Any++
Loading...
Searching...
No Matches
VANY_DISPACH macros

Macros to reduce boilerplate for declaring/defining open dispatch with vany_variant. Only neccessary for DLL scenarios. More...

Macros

#define VANY_DISPACH_DECLARE(export_, name, vany, signature, static_dispatch)
 Declare a singleton object for open vany dispatch.
#define VANY_DISPACH(namespace_, name)
 Define a vany dispatch singleton object in a source file.

Detailed Description

Macros to reduce boilerplate for declaring/defining open dispatch with vany_variant. Only neccessary for DLL scenarios.

Macro Definition Documentation

◆ VANY_DISPACH

#define VANY_DISPACH ( namespace_,
name )
Value:
ANY_SINGLETON(namespace_, name);
#define ANY_SINGLETON(namespace_, name,...)
Define a singleton object in a source file.
Definition anyxx.hpp:4235

Define a vany dispatch singleton object in a source file.

Parameters
namespace_The namespace for the singleton.
nameName of the singleton.

See also VANY_DISPACH_DECLARE, ANY_SINGLETON.

Examples
_2c_trait_any_variant.cpp.

◆ VANY_DISPACH_DECLARE

#define VANY_DISPACH_DECLARE ( export_,
name,
vany,
signature,
static_dispatch )
Value:
constexpr static inline auto name##_static_dispatch = \
anyxx::overloads{_detail_REMOVE_PARENS(static_dispatch)}; \
\
using name##_vany = vany; \
using name##_dynamic_dispatch = \
anyxx::dispatch<_detail_REMOVE_PARENS(signature)>; \
\
ANY_SINGLETON_DECLARE( \
, name, \
anyxx::dispatch_vany<name##_vany, name##_dynamic_dispatch, \
name##_static_dispatch>)
Open dispatch method. Solves the expression problem. See dispatch<R(Args...)> for details.
Definition anyxx.hpp:3904

Declare a singleton object for open vany dispatch.

Parameters
export_To supply an export macro in a DLL scenario.
nameName of the dispatch.
vanyType of vany.
signatureSignature of the dispatch.
static_dispatchStatic constexpr visitor for the non-any members of the vany.

See also VANY_DISPACH, ANY_SINGLETON_DECLARE.

Examples
_2c_trait_any_variant.cpp.