[C++-sig] enums and structs

joel de guzman djowel at gmx.co.uk
Mon May 20 02:16:51 CEST 2002


Hi Dave,

You don't have to CC me here, I subscribed to the list.

----- Original Message ----- 
From: "David Abrahams" :

> Since Joel is doing some work with enums now, it might make sense for him
> to implement this. What do you think, Joel?

Ok. I will. I was in fact thinking of a variation of the
syntax that you posted before. What do you think
about:

enum MyEnum { one = 1, two, three };

my_module.add(
    
    enum_<MyEnum>("MyEnum")
    [
        enum_val("one", one),
        enum_val("two", two),
        enum_val("three", three)
    ]
);

Kinda like Phoenix-ish. Tell me if it's too cute for your taste ;^/
Implementation wise, I'm still trying to grok the innards of
BPL. I'm not even close yet, but I'll be- surely ;-)

--Joel






More information about the Cplusplus-sig mailing list