Skip to content

cleanup: Remove AUTORET macro and clean up PassField overrides#64

Merged
ryanofsky merged 5 commits into
bitcoin-core:masterfrom
ryanofsky:pr/autoret
Dec 31, 2021
Merged

cleanup: Remove AUTORET macro and clean up PassField overrides#64
ryanofsky merged 5 commits into
bitcoin-core:masterfrom
ryanofsky:pr/autoret

Conversation

@ryanofsky
Copy link
Copy Markdown
Collaborator

This is part of #46. AUTORET macro is no longer needed with C++14 decltype(auto)

Can't use decltype(auto) everywhere because it doesn't seem to work in
SFINAE contexts. Substitution failure leads to compile errors instead of
just silently dropping functions from overload set.
Since decltype(auto) doesn't works inside SFINAE context, need to
replace enable_if<output.init()> with enable_if<output.get()>
Need to use decltype(expression) instead of decltype(auto) for get()
methods, because they are used in SFINAE contexts to detect whether
function arguments are input or output arguments.  For output-only
arguments, getParams().getXXX() method won't exist, so get method
shouldn't be declared. For input-only arguments, getResult().getXXX()
method won't exist, so get method shouldn't be declared.
This override is useful for other count(0) parameters, not just
ThreadMap, so no reason it needs to be specific to ThreadMap.

This commit follows up earlier commit cleaning up and unifying PassField
functions.
@ryanofsky ryanofsky merged commit bc6624a into bitcoin-core:master Dec 31, 2021
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Jun 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant