SFINAE for unique_ptr

Milian Wolff mail at milianw.de
Mon Feb 20 22:58:09 UTC 2012


On Monday 20 February 2012 23:48:58 Milian Wolff wrote:
> Heyho!
> 
> I my attempt to fix https://bugs.kde.org/show_bug.cgi?id=294306 I am now
> stuck at the SFINAE thingy to figure out the return type of most of
> unique_ptr's methods, namely _Pointer::type.
> 
> // use SFINAE to determine whether _Del::pointer exists
> 
> I have a rough understanding of how this should work like in theory, but
> does kdevelop already have any support for that? I cannot find any match
> for that
> :-/
> 
> Right now, unique_ptr<Anything> will always result in return-types of
> unique_ptr<Anything>::pointer which is "correct" but not what we want. Code
> completion doesn't grog it either...
> 
> So... help?

At least the basic SFINAE example from the wiki page works as it should, but 
I'm unsure about the more extended one...

I think the issue with unique_ptr might be related to variadic-templates: Our 
overload resolution does not take them into account I think.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120220/9b5e0bad/attachment.sig>


More information about the KDevelop-devel mailing list