libqasm
library for handling cQASM files
|
Table of overloaded callables with case-insensitive identifier matching. More...
Public Member Functions | |
void | add_overload (const std::string &name, const T &tag, const Types ¶m_types) |
Registers a callable. More... | |
std::pair< T, Values > | resolve (const std::string &name, const Values &args) |
Resolves the particular overload for the callable with the given case-insensitively matched name. More... | |
Table of overloaded callables with case-insensitive identifier matching.
T is the tag type of the callable/overload pair.
Definition at line 161 of file cqasm-v1-resolver.cpp.
#include <cqasm-v1-resolver.hpp>
|
inline |
Registers a callable.
The name should be lowercase; matching will be done case-insensitively. The param_types variadic specifies the amount and types of the parameters that (this particular overload of) the function expects. The C++ implementation of the function can assume that the value list it gets is of the right size and the values are of the right types. Note that ambiguous overloads are silently resolved by using the last applicable overload, so more specific overloads should always be added last.
Definition at line 175 of file cqasm-v1-resolver.cpp.
|
inline |
Resolves the particular overload for the callable with the given case-insensitively matched name.
Raises NameResolutionFailure if no callable with the requested name is found, raises an OverloadResolutionFailure if overload resolution fails, or otherwise returns the tag of the first applicable callable/overload pair and the appropriately promoted vector of value pointers.
Definition at line 195 of file cqasm-v1-resolver.cpp.