MLIR
20.0.0git
|
CRTP template for special wrapper types that are allowed to be passed in as 'None' function arguments and can be resolved by some global mechanic if so. More...
#include "Bindings/Python/PybindUtils.h"
Public Types | |
using | ReferrentTy = T |
Public Member Functions | |
Defaulting ()=default | |
Type casters require the type to be default constructible, but using such an instance is illegal. More... | |
Defaulting (ReferrentTy &referrent) | |
ReferrentTy * | get () const |
ReferrentTy * | operator-> () |
CRTP template for special wrapper types that are allowed to be passed in as 'None' function arguments and can be resolved by some global mechanic if so.
Such types will raise an error if this global resolution fails, and it is actually illegal for them to ever be unresolved. From a user perspective, they behave like a smart ptr to the underlying type (i.e. 'get' method and operator-> overloaded).
Derived types must provide a method, which is called when an environmental resolution is required. It must raise an exception if resolution fails: static ReferrentTy &resolve()
They must also provide a parameter description that will be used in error messages about mismatched types: static constexpr const char kTypeDescription[] = "<Description>";
Definition at line 39 of file PybindUtils.h.
using mlir::python::Defaulting< DerivedTy, T >::ReferrentTy = T |
Definition at line 41 of file PybindUtils.h.
|
default |
Type casters require the type to be default constructible, but using such an instance is illegal.
|
inline |
Definition at line 45 of file PybindUtils.h.
|
inline |
Definition at line 47 of file PybindUtils.h.
|
inline |
Definition at line 48 of file PybindUtils.h.