An any visitor class.
More...
#include <any_visitor.hpp>
|
template<typename T > |
void | register_visitor (const std::function< void(T &)> &f) |
| Register a callback function for a concrete type.
|
|
bool | visit (matador::any &x) |
| Applies the visitor pattern on an any object.
|
|
An any visitor class.
This class can be used to implement the visitor pattern for the any type class. Register function for as many types you need. Then call visit to apply the visitor pattern.
◆ function
Shortcut for the visitor callback function
◆ register_visitor()
template<typename T >
void matador::any_visitor::register_visitor |
( |
const std::function< void(T &)> & |
f | ) |
|
|
inline |
Register a callback function for a concrete type.
- Template Parameters
-
T | Type of the argument passed into the function |
- Parameters
-
◆ visit()
Applies the visitor pattern on an any object.
- Parameters
-
x | The any object the pattern should be applied on |
- Returns
- Returns true if a function could be applied.
The documentation for this class was generated from the following file:
- matador/utils/any_visitor.hpp