Re: How to get the type of $null?
Lindley French <[email protected]> Sun, 17 Oct 2021 09:58:47 -0700
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <CALwtg077XsUgqTYay3=mL9fj8RQUF+gENPYmj7_12W34zxRotQ@mail.gmail.com> |
Ah, this works:
void ReturnType() {}
template <typename T>
T ReturnType(const T& val) { return val; }
decltype(ReturnType($null))
On Sun, Oct 17, 2021 at 9:15 AM Lindley French <[email protected]> wrote:
> I'd like to retrieve the eventual return type of the function, e.g. the
> thing that determines whether $null maps to 0 or nothing.
>
> I tried decltype($null) but that doesn't work when $null is nothing, e.g.
> decltype() is ill-formed.
>
> I'm trying to call a sub-typemap within a lambda and I need the return
> type of the lambda to work out. I could make it work with just a scope
> block instead of a lambda, but that's not as clean.
>
_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user