Andre Poenitz wrote:

> On Wed, Sep 24, 2003 at 01:55:09PM +0000, Angus Leeming wrote:
>> Given an enum, is there a semi-automated way of returning a vector of
>> all named enum values? The best I can come up with is this:
> 
> None that I am aware of.
> 
> Actually, your solution does not work for e.g.
> 
>  enum TransformID {
>          Rotate,
>          Resize,
>          Clip = 7,
>          Extra
>  };
>  
> Your program just lists all numbers from 0 to 8, doesn't it?

That's why the function is called 'all_values_if_consecutive' and is the 
problem I found that I couldn't overcome.

> [My personal opinion is that enums are still second class citizens in
> C++ much like C-style arrays..]

Which doesn't help us much...

-- 
Angus

Reply via email to