[vtk-developers] Unique enum values

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Mar 14 21:00:41 EDT 2012


I was thinking the same,

namespace vtk
{
enum OperationType
{
  UNION=0,
  INTERSECTION,
  DIFFERENCE
}
} // End vtk namespace

Then vtk::UNION, but I have no idea how that works with the wrapping.
Last I heard I still couldn't use anything other than anonymous enums
either - it would be great if that has improved.

Marcus

On Wed, Mar 14, 2012 at 8:49 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> namespaces are great. ITK has used them for over 10 ten years. But I'm
> not sure how to use them just for enum's.
>
>
> On Wed, Mar 14, 2012 at 5:31 PM, David E DeMarle
> <dave.demarle at kitware.com> wrote:
>> Is there any reason not to use namespaces anymore?
>>
>> On Mar 14, 2012 7:21 PM, "Bill Lorensen" <bill.lorensen at gmail.com> wrote:
>>>
>>> Folks,
>>>
>>> A user recently reported that an enum value "DIFFERENCE" was defined
>>> by Visual Studio 2008. This caused compilation errors in the vtk class
>>> that defined and used it.
>>>
>>> VTK classes that define enums do not follow a consistent convention.
>>> Some use a VTK_ prefix, others do not.
>>>
>>> Without a unique prefix VTK may have compilation issues if, in the
>>> future, a compiler decides to define one of the values that we have
>>> created.
>>>
>>> I propose, that for VTK6, we establish a convention that enum values
>>> always have a prefix VTK_.
>>>
>>> About 370 vtk*.h files have an enum. I'm willing to take a stab at
>>> applying this convention throughout VTK.
>>>
>>> Bill
>>>
>>>
>>> --
>>> Unpaid intern in BillsBasement at noware dot com
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



More information about the vtk-developers mailing list