microsoft / microsoft/wil

How about WI_AreAnyOtherFlagsSet?

Open
#333 1 comment 0 reactions 1 assignee View on GitHub

@bradlitterell is already working on this.

Since Jun 16, 2023.

Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

A common usage pattern is something like this:

 // make sure only the valid flags are set
RETURN_HR_IF(<someError>, WI_IsAnyFlagSet(dwFlags, ~(FLAG1 | FLAG2 | FLAG3));

I think this would be clearer if it read thus:

RETURN_HR_IF(<someError>, WI_AreAnyOtherFlagsSet(dwFlags, FLAG1 | FLAG2 | FLAG3);

It states the direct condition of the "IF" without hiding the negation as a small character in the middle of the line.

If I created a PR to add this variant, would the project support it?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.