byte: workaround for c++17 std::byte definition #8208
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch renames the Arduino type
byte
to something else in order to avoid ambiguous/conflicting types when c++17,byte
, andusing namespace std
are used together.This follows up #8089 (comment), gmag11/NtpClient#115 and things4u/ESP-1ch-Gateway#82.
This comment is true but libraries and projects will prefer to use previous version of this core than to fix.
In the Arduino world, ascendant compatibility still prevails.
This is a hack, relying on the following facts
byte
is always defined inArduino.h
std::byte
is declared only in<cstddef>
<functional>
and<bits/cpp_type_traits.h>
.The two latters were found with
grep
after noticing that the first was not sufficient.fixes #8089