libqasm
library for handling cQASM files
Public Member Functions | List of all members
cqasm::v1::resolver::OverloadResolver< T > Class Template Reference

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 &param_types)
 Adds a possible overload to the resolver. More...
 
std::pair< T, Valuesresolve (const Values &args)
 Tries to resolve which overload belongs to the given argument list, if any. More...
 

Detailed Description

template<class T>
class cqasm::v1::resolver::OverloadResolver< T >

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.

Member Function Documentation

◆ add_overload()

template<class T>
void cqasm::v1::resolver::OverloadResolver< T >::add_overload ( const T &  tag,
const Types param_types 
)
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.

◆ resolve()

template<class T>
std::pair<T, Values> cqasm::v1::resolver::OverloadResolver< T >::resolve ( const Values args)
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.


The documentation for this class was generated from the following file: