From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1C7AEBC69 for ; Sat, 24 Feb 2007 10:09:43 +0100 (CET) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l1O99gE1022018 for ; Sat, 24 Feb 2007 10:09:42 +0100 Received: (qmail invoked by alias); 24 Feb 2007 09:09:42 -0000 X-Provags-ID: V01U2FsdGVkX19/p1JCLed/9/SLQXSb7lH0xIRmcLoyqKW4JJDNhj tVpg== Message-ID: <45E00103.9020809@fantasymail.de> Date: Sat, 24 Feb 2007 10:10:27 +0100 From: micha User-Agent: Icedove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: caml-list@inria.fr Subject: coding c++ enum type Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 45E000D6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; enum:01 interfacing:01 flags:01 variants:01 flags:01 initialized:01 variant:02 variables:02 coding:05 iterate:06 michael:07 function:08 flag:09 real:10 between:13 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