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/NanobindUtils.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 47 of file NanobindUtils.h.
using mlir::python::Defaulting< DerivedTy, T >::ReferrentTy = T |
Definition at line 49 of file NanobindUtils.h.
|
default |
Type casters require the type to be default constructible, but using such an instance is illegal.
|
inline |
Definition at line 53 of file NanobindUtils.h.
|
inline |
Definition at line 55 of file NanobindUtils.h.
|
inline |
Definition at line 56 of file NanobindUtils.h.