From 5953704475147536974
X-Google-Thread: 7894ca11fe,cc8aa11441b7bb9c
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Feb 2010 00:50:01 -0600
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
To: (Usenet)
From: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@googlemail.com>
Newsgroups: comp.std.c++
Subject: Re: Getting rid of "typename ...::type" for some cases?
Organization: http://groups.google.com
Sender: cppmods@cs.rpi.edu
Approved: james.dennett@gmail.com
Message-ID: <7bade475-2428-4066-8660-5707eeff2019@h2g2000yqj.googlegroups.com>
References: <hk6feu$un6$00$1@news.t-online.com>
Content-Type: text/plain; charset=ISO-8859-1
X-Original-Date: Mon, 1 Feb 2010 11:08:18 -0800 (PST)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Date: Tue,  2 Feb 2010 00:46:29 CST
Lines: 29
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-gddj1RFge7Vq7j/vxm7mXDScJjl05EsHCdhSlpd2CUsQeG4knsuwk0KPe6wW965rdZdluB+V3XzL0lW!Cvu+CDa+Yy5+f4f/Lwchw+HRjq51IWBH9bJLCoL6Aq8SIxPgkfA18Fxie0V3VRZpT37sMC9cGbks!iTB5rt7hMCpYhDoKM8WXeKvX4g==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Xref: g2news1.google.com comp.std.c++:2132

On 1 Feb., 18:38, "Johannes Schaub (litb)" <schaub-johan...@web.de>
wrote:
> I wonder whether it would be possible to get rid of "typename <tmp>::type"
> for the most common cases (enable_if (?))
>
> template<bool C, typename T = void>
> using enable_if = typename enable_if<C, T>::type;
>
> Does that allow the following?
>
> template<typename T>
> enable_if<is_pointer<T>::value> f();
>
> If it does, has it been considered to make it that way?

I don't think that you can reintroduce the name enable_if,
but except for this the approach looks both feasible and
nice to me. Regarding your second question: I don't
think that it has been considered - nice idea.

- Daniel


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



