libqasm
library for handling cQASM files
|
Represents a set of possible overloads for the parameter types of a function, gate, or error model. More...
Public Member Functions | |
void | add_overload (const T &tag, const Types ¶m_types) |
Adds a possible overload to the resolver. More... | |
std::pair< T, Values > | resolve (const Values &args) |
Tries to resolve which overload belongs to the given argument list, if any. More... | |
Represents a set of possible overloads for the parameter types of a function, gate, or error model.
T is some tag type identifying the overload. In case of a function, T would contain at least the return type, but maybe also a lambda to represent the actual function. 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 111 of file cqasm-v1-resolver.cpp.
|
inline |
Adds a possible overload to the resolver.
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 122 of file cqasm-v1-resolver.cpp.
|
inline |
Tries to resolve which overload belongs to the given argument list, if any.
Raises an OverloadResolutionFailure if no applicable overload exists, otherwise the tag corresponding to the first proper overload and the appropriately promoted vector of value pointers are returned.
Definition at line 132 of file cqasm-v1-resolver.cpp.