template<typename Impl, typename Result>
class fmt::ArgVisitor< Impl, Result >
An argument visitor based on the curiously recurring template pattern <http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern>
_.
To use ~fmt::ArgVisitor
define a subclass that implements some or all of the visit methods with the same signatures as the methods in ~fmt::ArgVisitor
, for example, ~fmt::ArgVisitor::visit_int()
. Pass the subclass as the Impl template parameter. Then calling ~fmt::ArgVisitor::visit
for some argument will dispatch to a visit method specific to the argument type. For example, if the argument type is double
then the ~fmt::ArgVisitor::visit_double()
method of a subclass will be called. If the subclass doesn't contain a method with this signature, then a corresponding method of ~fmt::ArgVisitor
will be called.
Example**::
class MyArgVisitor : public fmt::ArgVisitor<MyArgVisitor, void> { public: void visit_int(int value) { fmt::print("{}", value); } void visit_double(double value) { fmt::print("{}", value ); } };
Definition at line 1673 of file format.h.