Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++: Refactor {address,bytes32} constructors #646

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

chfast
Copy link
Member

@chfast chfast commented May 16, 2022

Requires #644

{}
inline constexpr explicit address(uint64_t v) noexcept : evmc_address{}
{
for (size_t i = sizeof(bytes) - sizeof(v); i < sizeof(bytes); ++i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just shorter.

This replaces std::error_code and exceptions with std::optional<bytes>
to inform about invalid hex input.
@chfast chfast force-pushed the hex_literals branch 3 times, most recently from 4fa9b27 to 67ad485 Compare May 26, 2022 07:38
@chfast chfast force-pushed the hex_literals branch 2 times, most recently from 060c177 to 940787d Compare June 2, 2022 11:42
Base automatically changed from hex_literals to master June 2, 2022 14:30
@axic
Copy link
Member

axic commented Aug 26, 2022

@chfast what happened to this?

@axic
Copy link
Member

axic commented Oct 23, 2022

@chfast merge or not?

@axic
Copy link
Member

axic commented May 3, 2023

@chfast still on the verge of merge?

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.

2 participants