Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion is_enum<T> ATTN: Andrei Alexandrescu and ilk
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter Dimov  
View profile  
 More options Mar 18 2002, 10:38 am
Newsgroups: comp.lang.c++.moderated
From: pdi...@mmltd.net (Peter Dimov)
Date: 18 Mar 2002 10:39:28 -0500
Local: Mon, Mar 18 2002 10:39 am
Subject: Re: is_enum<T> ATTN: Andrei Alexandrescu and ilk
rani_shar...@hotmail.com (Rani Sharoni) wrote in message <news:df893da6.0203170237.3760f3c4@posting.google.com>...

 > I looked at 14.8.2/2 (indicated by Peter) and wondered if it is
 > possible to use Paul technique in order to detect whether some type T
 > contains some type member.
 > This is known challenge by Andrei Alexandrescu (look for post named
 > "Reiterated question").
 >
 > The code might look like the following:
[...]
 >      template<class U> static yes check(typename U::key_type *);
 >      template<class U> static no  check(...);
 >
 > public:
 >      static const bool result =
 >          sizeof(check<T>(0)) == sizeof(yes);
 >
 > is the above code is legal in standard C++?

Amazingly, it think that it is. You are the proud inventor of the
has_nested_type<> technique. :-)

      [ Send an empty e-mail to c++-h...@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google