Class explicit_conversion_dispatch
class explicit_conversion_dispatch;
using conversion_dispatch = explicit_conversion_dispatch;
Class explicit_conversion_dispatch
models a dispatch type for explicit type conversion expressions. It meets the ProAccessible requirements of applicable types. conversion_dispatch
is an alias of explicit_conversion_dispatch
.
Member Functions
Name |
Description |
(constructor) [nothrow] |
constructs an explicit_conversion_dispatch object |
operator() |
invokes the dispatch |
Member Types
Name |
Description |
accessor |
provides accessibility to proxy |
Example
#include <iostream>
#include "proxy.h"
struct IntConvertible : pro::facade_builder
::add_convention<pro::conversion_dispatch, int() const>
::build {};
int main() {
pro::proxy<IntConvertible> p = pro::make_proxy<IntConvertible, short>(123); // p holds a short
std::cout << static_cast<int>(*p) << "\n"; // Prints: "123"
}
See Also