Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Walter Mascarenhas<walter.mascarenhas@googlemail.com> |
| Newsgroups | comp.std.c++ |
| Subject | Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code) |
| Date | Thu, 24 Jan 2013 15:15:38 -0800 (PST) |
| Organization | unknown |
| Lines | 64 |
| Sender | std-cpp-request@vandevoorde.com |
| Approved | stephen.clamage@oracle.com |
| Message-ID | <92a59a4e-4c63-44dd-8205-9c030d578515@googlegroups.com> (permalink) |
| References | <88b1e391-5730-4a5e-98f7-8af19543ba1a@googlegroups.com> <kdmlij$dm5$1@dont-email.me> |
| NNTP-Posting-Host | ukdeH9ijF//0jMadMgNi/5vBoelIvf+pufb7mIMQsms= |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | news.albasani.net fgXLLob33Hj2LS+uMT65hBCpOmYrO1N16lvz0soiHsHyjtmT7KrI1oohnbLRB9D1BGkJPn/Py2oInxJTmwr0FA== |
| X-Complaints-To | abuse@albasani.net |
| NNTP-Posting-Date | Thu, 24 Jan 2013 23:15:56 +0000 (UTC) |
| X-Mailer | Perl5 Mail::Internet v2.05 |
| X-Submission-Address | std-cpp-submit@vandevoorde.com |
| Cancel-Lock | sha1:4+H/KYiK6EUMO2opMkaEIMex4v0= |
| X-Original-Date | Thu, 24 Jan 2013 05:49:31 -0800 (PST) |
| Xref | csiph.com comp.std.c++:586 |
Show key headers only | View raw
On Tuesday, January 22, 2013 9:26:32 PM UTC-2, Daniel Krügler wrote:
> Am 22.01.2013 17:54, schrieb Walter Mascarenhas:
>
>
> > When I use constructs like std::enable_if my code gets polluted with many typenames, as in
> > typename std::enable_if< std::is_same<typename A::X, typename B::Y>::value,
> > typename C::Z>::type
>
> > Would it be too costly to introduce a symbol, say ':', in the language so
> > that "T:X" is an abbreviation for "typename T::X"?
>
>
> An alternative solution without need of any further language
> extensions is the usage of a template alias instead. Typical examples
> are:
>
> template<bool C, class T = void>
> using EnableIf = typename std::enable_if<C, T>::type;
>
>
> HTH& Greetings from Bremen,
>
>
>
> Daniel Krügler
>
Thanks for the reply. This is indeed a
good alternative for people with good
compilers.
Unfortunately I am stuck with Visual C++
and won't be able to apply this solution
for a while. Of course microsoft is the
one to blame here and people in this
list shouldn't worry about this question.
Greetings from Brazil,
walter.
>
>
> --
>
> [ comp.std.c++ is moderated. To submit articles, try posting with your ]
>
> [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
>
> [ --- Please see the FAQ before posting. --- ]
>
> [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next — Previous in thread | Next in thread | Find similar
Could we use T:X to abbreviate "typename T::X"? (and get cleaner code) Walter Mascarenhas<walter.mascarenhas@googlemail.com> - 2013-01-22 10:54 -0600
Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code) Daniel Krügler <daniel.kruegler@googlemail.com> - 2013-01-22 15:26 -0800
Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code) Walter Mascarenhas<walter.mascarenhas@googlemail.com> - 2013-01-24 15:15 -0800
Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code) SG<s.gesemann@googlemail.com> - 2013-02-27 09:05 -0800
Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code) Daniel Krügler <daniel.kruegler@googlemail.com> - 2013-02-27 10:52 -0800
csiph-web