Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #600

Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code)

From Daniel Krügler <daniel.kruegler@googlemail.com>
Newsgroups comp.std.c++
Subject Re: Could we use T:X to abbreviate "typename T::X"? (and get cleaner code)
Date 2013-02-27 10:52 -0800
Organization A noiseless patient Spider
Message-ID <kgli14$op4$1@dont-email.me> (permalink)
References <88b1e391-5730-4a5e-98f7-8af19543ba1a@googlegroups.com> <kdmlij$dm5$1@dont-email.me> <2ac309c1-b67d-4e8f-b058-eeffcbed7e90@j29g2000vby.googlegroups.com>

Show all headers | View raw


Am 27.02.2013 18:05, schrieb SG:
>
> On Jan 23, 12:26 am, Daniel Krügler wrote:
> [snip]
>
>>   template<bool C, class T = void>
>>   using EnableIf = typename std::enable_if<C, T>::type;
>
>
> Is the right hand side of this template alias considered an immediate
> context with respect to SFINAE?


Let me start with a general remark in regard to "immediate context"
used in 14.8: The Standard committee had introduced this term knowing
that this is a fuzzy definition. In regard to alias templates the
wording *could* be interpreted as if the "definition of alias would be
a different context. In general, this is not intended, because alias
substitution is supposed to happen very early. I think that this usage
of alias template is safe (and considered to be in the immediate
context) when you compare it with

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1558

The current suggestion is that

a) Substitution happens in the immediate context of the template that
had causes the substitution

b) Access checking (see CWG issue

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1554
) is performed in the context of the definition of alias template.

HTH & Greetings from Bremen,

Daniel Krügler



--
[ 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 | NextPrevious in thread | Find similar


Thread

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