Added TriState to WTF and started using it in one place
Created attachment 186030 [details] Patch
Committed r141588: <http://trac.webkit.org/changeset/141588>
Comment on attachment 186030 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186030&action=review > Source/WTF/wtf/TriState.h:35 > +}; If you use the new EnumClass.h, you can make this: ENUM_CLASS_BEGIN(TriState) { False, True, Mixed } ENUM_CLASS_END(TriState); And everywhere you use TriState::False, TriState::True, and TriState::Mixed. Not sure that that is better, but fyi for your consideration.
Comment on attachment 186030 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=186030&action=review > Source/WTF/WTF.xcodeproj/project.pbxproj:-313 > FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; }; > - FE43302716A7ADC300D1585D /* TypeSafeEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = FE43302616A7ADC300D1585D /* TypeSafeEnum.h */; }; Why are you removing the TypeSafeEnum? > Source/WTF/WTF.xcodeproj/project.pbxproj:1264 > A8A47487151A825B004123FF /* WTFThreadData.h in Headers */, > + 149EF16316BBFE0D000A4331 /* TriState.h in Headers */, Build section unsorted :( >> Source/WTF/wtf/TriState.h:35 >> +enum TriState { >> + FalseTriState, >> + TrueTriState, >> + MixedTriState >> +}; > > If you use the new EnumClass.h, you can make this: > > ENUM_CLASS_BEGIN(TriState) { > False, > True, > Mixed > } ENUM_CLASS_END(TriState); > > And everywhere you use TriState::False, TriState::True, and TriState::Mixed. Not sure that that is better, but fyi for your consideration. Instead of an enum, I wonder if this would not benefit from a class with the logic function explicitly defined? If you plan to use the TriState in logic operations, it would be beneficial to define and, or and not.