Skip to content

Make CRGB::operator bool() explicit - #1450

Merged
kriegsman merged 1 commit into
FastLED:masterfrom
ssilverman:crgb-explicit-opbool
Jan 22, 2023
Merged

kriegsman merged 1 commit into
FastLED:masterfrom
ssilverman:crgb-explicit-opbool

Conversation

@ssilverman

Copy link
Copy Markdown
Contributor

Resolves #819

@ssilverman

Copy link
Copy Markdown
Contributor Author

Converting to a draft until I verify that this works on compilers before C++ 11.

@ssilverman
ssilverman marked this pull request as draft November 27, 2022 03:04
@ssilverman

Copy link
Copy Markdown
Contributor Author

@kriegsman what is the minimum acceptable compiler version for FastLED? For example, as-is, this change works for C++11. Should I target C++03?

@kriegsman

Copy link
Copy Markdown
Member

As I think noted elsewhere, let's aim for C++11 compliance; no need to go all the way back to C++03 since the Arduino IDE is providing C++11.

@ssilverman

Copy link
Copy Markdown
Contributor Author

One other note is that implicit conversions will need to be explicitly cast or used as a Boolean expression. See here: https://github.com/ssilverman/QNEthernet/blob/master/README.md#operator-bool-and-explicit

If that caveat is fine, then let’s get this in.

@ssilverman
ssilverman marked this pull request as ready for review December 12, 2022 11:47
@kriegsman
kriegsman merged commit ee59c40 into FastLED:master Jan 22, 2023
@kriegsman

Copy link
Copy Markdown
Member

Thank you for the contributions and your help with FastLED!
I'm sure that this will break someone's code somewhere, possibly even mine ... I can't say for sure that I haven't accidentally done this, but this will be easy to find and fix. Thanks again for all the contributions of time and thinking and code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Making CRGB::operator bool() explicit would be useful

2 participants