Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5945731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:43:22+00:00 2026-05-22T16:43:22+00:00

This is more a question I’m asking to understand rather than figure out a

  • 0

This is more a question I’m asking to understand rather than figure out a problem. Consider the following two:

[Flags]
    public enum Flags
    {
        NONE = 0x0,
        PASSUPDATE = 0x1,
        PASSRENDER = 0x2,
        DELETE = 0x4,
        ACCEPTINPUT = 0x8,
        FADE_IN = 0x10,
        FADE_OUT = 0x20,
        FADE_OUT_COMPLETE = 0x40
    }

[Flags]
    public enum Flags
    {
        NONE = 0x0,
        PASSUPDATE,
        PASSRENDER,
        DELETE,
        ACCEPTINPUT,
        FADE_IN ,
        FADE_OUT,
        FADE_OUT_COMPLETE
    }

If I do bit checking on something using the latter enum there sometimes is overlap (I think something like DELETE is interpreted as PASSUPDATE | PASSRENDER, while in the first example each entry is independent of the other (i.e. DELETE is only DELETE and cannot be proven using a combination of a different set of flags).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:43:23+00:00Added an answer on May 22, 2026 at 4:43 pm

    Without explicit numbers, enums increment by 1 each time (even with [Flags] specified), so you get:

    [Flags]
    public enum Flags
    {
        NONE = 0x0,
        PASSUPDATE, // = 1
        PASSRENDER,// = 2
        DELETE,// = 3
        ACCEPTINPUT,// = 4
        FADE_IN ,// = 5
        FADE_OUT,// = 6
        FADE_OUT_COMPLETE// = 7
    }
    

    which is simply not the numbers you wanted (and certainly isn’t bitwise flags which are typically successive powers of 2)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this is more like Math question rather than programming but since I'm
This more of a style question, rather than a how to. So I've got
This is more of a question about best pattern and practice than asking about
EDIT: This question is more about language engineering than C++ itself. I used C++
This is more of a philosophical question than anything, so give me your thoughts.
(This is more of a curiousity question than any pending disaster :D ) So
This is more a theoretical question than a practical one, but given I undestand
This is more a curiosity question than a pressing one. This question is looking
This is more a curiosity question than anything. Say I supply a LinkedHashMap with
I am aware that this is a more subjective question than is preferred, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.