Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Ticket #24 (new defect)

Opened 15 years ago

Last modified 14 years ago

Implement QFlags

Reported by: eldar Assigned to: eldar
Priority: major Version:
Keywords: Cc:

Description

Enums in C++ and D are different. For now it is better to implement them just as enums.

Change History

05/15/10 09:51:46 changed by maxter

Ok, we need to make a decision. There are three ways to go:

1. Make enums and flags indistinguishable in QtD, acquiring type safety of flags and leaving enums as usafe as they are now.

2. Leave flags as ints. This is the most unfortunate situation since we don't have any guarantees at all. The user can mess up enums by or'ing them *and* he can mess up flags by passing whatever he wants to parameters expecting flags of a certain type.

3. Implement flags as D enums and introduce a QEnum type that would disallow bitwise operations on its values. This may turn out to be a sound solution.