[cfe-dev] Type traits to identify pointers to ObjC types?
Nicola Gigante
nicola.gigante at gmail.com
Wed Dec 21 13:51:11 PST 2011
Il giorno 19/dic/2011, alle ore 17:00, Douglas Gregor ha scritto:
>
> This kind of thing works fine in C++98/03 as well. It's probably worth checking that T is a pointer type, so you don't treat something like
>
> struct X {
> operator id() const;
> };
>
> as an Objective-C pointer type.
>
Thanks.
What about the standard is_base_of trait? libc++ implements
it with an intrinsic, if supported, or with template tricks if not.
Looking at it, the "tricks" version should already work with Objective-C types
(apart from a is_class check, maybe) while the clang intrinsic seems not.
Could it be possible to make it work with Objective-C types?
Same thing with other traits, like is_class. Should they return
sensible answers on Objective-C types?
> - Doug
>
Nicola
More information about the cfe-dev
mailing list