Adapts a function pointer for use as a static visitor.

Adapts the function given at construction for use as a static visitor of type `T` with result type `R`.

static_visitor
<R>
R (*)(T)

Constructs the visitor with the given function.

R

unspecified-forwarding-type
void

const U&

If passed a value or reference of type `T`, it invokes the function given at construction, appropriately forwarding `operand`.

Returns the result of the function invocation.

The overload taking a value or reference of type `T` throws if the invoked function throws. The overload taking all other values always throws ``bad_visit``.

Returns a visitor object that adapts function pointers for use as a static visitor.

Constructs and returns a ``visitor_ptr_t`` adaptor over the given function.

`visitor_ptr_t`<T,R>

R (*)(T)

Returns a ``visitor_ptr_t`` visitor object that, when applied, invokes the given function.

Will not throw. (Note, however, that the returned `visitor object` may throw when applied.)