Re: batching gets and searching



Colm Smyth <Colm Smyth ireland sun com> writes: 
> I don't like to assume that the clients of GConf will
> always be written in C.
> 

The (admittedly rather verbose) solution in C++ is an explicit type
conversion:

 MyFlagsEnumType (FLAG_ONE | FLAG_TWO) 

Also, for a C++ binding such as Inti (http://sources.redhat.com/inti/)
a GConf interface will be exported that's C++-native and uses int here.

Most people writing C++ stuff with the C library will also be using
GLib and likely GTK+, with the enum convention, so it's better to be
consistent than fix things in half the places. People shouldn't need
to look in the docs to see which it is for a given function.

FWIW the argument for using the enum type instead of int is mostly
documentation of which flags are expected, I believe.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]