|
Prev: Simple Coding Challenges
Next: Money transfers directly to YOUR PayPal account from strangers around the World
From: DerekBaker on 8 Apr 2008 20:58 It's impossible to return the whole enum, rather just one element of it? Thanks -- Derek
From: Ian Collins on 8 Apr 2008 21:01 DerekBaker wrote: > It's impossible to return the whole enum, rather just one element of it? > The concept is meaningless. An enum is a set of values, so what do you mean by "whole enum"? -- Ian Collins.
From: Richard Heathfield on 8 Apr 2008 21:06 DerekBaker said: > It's impossible to return the whole enum, rather just one element of it? Yes, it's impossible (short of populating, say, a vector with all the possible values and then returning the vector). Enumerations are not "collections" of values, but lists of possible values, so the term "the whole enum" doesn't really make any sense. It's a bit like asking whether it's possible to return all the possible values a char can have. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999
From: Anand Hariharan on 8 Apr 2008 21:57
On Wed, 09 Apr 2008 01:58:04 +0100, DerekBaker wrote: > It's impossible to return the whole enum, rather just one element of it? enum is a type. You return values of a type. -- ROT-13 email address to reply |