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 8890123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:25:40+00:00 2026-06-14T22:25:40+00:00

According to the BitmaskType concept, the implementation has to assure that the following statement

  • 0

According to the BitmaskType concept, the implementation has to assure that the following statement is well formend: (listed in §17.5.2.1.3.4)

The value Y is set in the object X if the expression X & Y is nonzero.

where X and Y are of concept-type BitmaskType.

When trying the following simple code snippet with gcc 4.7 I get template deduction errors:

#include <future>

int main() {
    (std::launch::async & std::launch::async) != 0;
}

Error:

error: no match for 'operator!=' in '(std::launch)1 != 0'
... followed by tons of deduction errors

Is this a bug in gcc or am I just getting something wrong here? If yes, what is the proper way to perform this kind of check?

I already checked gcc buglist but couldn’t find anything covering this topic.

  • 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-06-14T22:25:41+00:00Added an answer on June 14, 2026 at 10:25 pm

    The members of enum classes are not meant to convert to int implicitly or vice versa. You can either make sure that your bitmask type is converted to int or use the zero value of the enum class. I’d think the latter is preferable:

    (std::launch::async & std::launch::async) != std::launch()
    

    (I have also added parenthesis around the bitwise and operation since it has higher precedence than the comparison and it doesn’t really make much sense to bitwise and a Boolean value with a bitmask type).

    The easiest way to see this is 7.2 [enum.dcl] paragraph 9:

    … Note that this implicit enum to int conversion is not provided for a scoped enumeration: …

    This is, however, within a non-normative Example. Tracking the rules for scoped rules in the standard may require ruling out all the cases where conversions are allowed and currently don’t quite fancy this exercise.

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

Sidebar

Related Questions

According to the C++11 standard, is the following program well-formed and portable C++? int
According MSDN, FxCop is an application that analyzes managed code assemblies (code that targets
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
According to Hibernate documentation : After observing that arrays cannot be lazy , you
According To reflector , ExpandoObject Does implemenet IDictionary<string, object> How ever I have this
According to the Ruby Set class's documentation, == Returns true if two sets are
According to wikipedia : functional programming is a programming paradigm that treats computation as
According to the C++0x spec , the following is legal class A { A(int
According to Security Space The penetration of PHP on Apache servers has been falling
According to the Memcached FAQ , the following occurs when an attempt to allocate

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.