mrdocs::dom::ValueFrom

Convert an object of type T to dom::Value.

Synopsis

Declared in <mrdocs/Dom/Value.hpp>

template<
    class Context,
    HasValueFrom<Context> T>
void
ValueFrom(
    T&& t,
    Context const& ctx,
    Value& v);

Description

This function attempts to convert an object of type T to dom::Value using

  • a user‐provided overload of tag_invoke.

  • one of dom::Value's constructors,

Conversion of user‐provided types is done by calling an overload of tag_invoke found by argument‐dependent lookup. Its signature should be similar to:

void tag_invoke( ValueFromTag, dom::Value&, T,  Context const& );

or

void tag_invoke( ValueFromTag, dom::Value&, T );

The overloads are checked for existence in that order and the first that matches will be selected.

The ctx argument can be used either as a tag type to provide conversions for third‐party types, or to pass extra data to the conversion function.

Exception Safety

Strong guarantee.

Template Parameters

Name Description

T

The type of the object to convert.

Context

The type of context passed to the conversion function.

Parameters

Name Description

t

The object to convert.

ctx

Context passed to the conversion function.

v

dom::Value out parameter.