mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-04 04:07:22 +00:00
Used feature macro for if constexpr in a public header (#16836)
### Description Use feature macro for `if constexpr` ### Motivation and Context We still do not require customers to use C++17 compiler.
This commit is contained in:
parent
d0df83e408
commit
bf006d34a9
1 changed files with 4 additions and 0 deletions
|
|
@ -2181,7 +2181,11 @@ struct CustomOpBase : OrtCustomOp {
|
|||
OrtCustomOp::GetVariadicInputHomogeneity = [](const OrtCustomOp* this_) { return static_cast<int>(static_cast<const TOp*>(this_)->GetVariadicInputHomogeneity()); };
|
||||
OrtCustomOp::GetVariadicOutputMinArity = [](const OrtCustomOp* this_) { return static_cast<const TOp*>(this_)->GetVariadicOutputMinArity(); };
|
||||
OrtCustomOp::GetVariadicOutputHomogeneity = [](const OrtCustomOp* this_) { return static_cast<int>(static_cast<const TOp*>(this_)->GetVariadicOutputHomogeneity()); };
|
||||
#ifdef __cpp_if_constexpr
|
||||
if constexpr (WithStatus) {
|
||||
#else
|
||||
if (WithStatus) {
|
||||
#endif
|
||||
OrtCustomOp::CreateKernelV2 = [](const OrtCustomOp* this_, const OrtApi* api, const OrtKernelInfo* info, void** op_kernel) -> OrtStatusPtr {
|
||||
return static_cast<const TOp*>(this_)->CreateKernelV2(*api, info, op_kernel);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue