Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > anonymous enums...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 9491 of 9971
Post > Topic >>

anonymous enums and templates

by "Roman.Perepelitsa@[EMAIL PROTECTED] " <Roman.Perepelitsa@[EMAIL PROTECTED] > Apr 11, 2008 at 11:34 AM

Is this program valid? Why? If yes then what it prints?

#include <iostream>
#include <ostream>

enum { value };

template <class T>
int f(T) { return 1; }

int f(int) { return 2; }

int main()
{
   std::cout << f(value) << std::endl;
}

Roman Perepelitsa.

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 4 Posts in Topic:
anonymous enums and templates
"Roman.Perepelitsa@[  2008-04-11 11:34:56 
Re: anonymous enums and templates
=?ISO-8859-1?Q?Daniel_Kr=  2008-04-11 18:08:08 
Re: anonymous enums and templates
Greg Herlihy <greghe@[  2008-04-12 12:13:11 
Re: anonymous enums and templates
Looney <hardy_melbourn  2008-04-13 12:46:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Sep 4 23:52:47 CDT 2008.