Home | Libraries | People | FAQ | More |
trial::dynamic::visit — Mutable visitation.
// In header: <boost/libs/trial.protocol/include/trial/dynamic/algorithm/visit.hpp> template<typename Visitor, template< typename > class Allocator> auto visit(Visitor && visitor, basic_variable< Allocator > & variable);
Invokes the call operator on the visitor whose type matches the stored type of the dynamic variable. The type is resolved using the normal rules for C++ function overloading. All call operators must use the same return type.
struct visitor { // Matches any stored type; returns nothing. template <typename T> void operator()(T); }; dynamic::variable data = 1; assert(data.same<int>()); dynamic::visit(visitor{}, data); // Invokes visitor.operator()(int)
Parameters: |
|
||||
Returns: |
Return type of |