caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* coding c++ enum type
@ 2007-02-24  9:10 micha
  2007-02-24 10:52 ` [Caml-list] " Richard Jones
  2007-02-24 21:33 ` Nathaniel Gray
  0 siblings, 2 replies; 3+ messages in thread
From: micha @ 2007-02-24  9:10 UTC (permalink / raw)
  To: caml-list


when interfacing to c, what is the preferred method to represent enums 
which are used as flags in c?
I can choose between:
1. using a variant type and  a list of those variants to represent the 
or-ed flags. Then I have to iterate over the list to calculate the 
combined flag value.

2. I can export global variables initialized with the real value of the 
flags and a function which combines  (with "or") them together,

Is one method better than the other?


Michael


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-24 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-24  9:10 coding c++ enum type micha
2007-02-24 10:52 ` [Caml-list] " Richard Jones
2007-02-24 21:33 ` Nathaniel Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).