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

LLVM16: Investigate removing cost from value_or #322

Open
ericpassmore opened this issue Dec 14, 2024 · 0 comments
Open

LLVM16: Investigate removing cost from value_or #322

ericpassmore opened this issue Dec 14, 2024 · 0 comments

Comments

@ericpassmore
Copy link
Contributor

In the file libraries/eosilib/core/eosio/binary_extenstion.hpp There are two value_or functions one with const restriction and one without. Clearly the object state is modified, and the second function will never work, removing the restrictive, const only function from the code and keeping the first value_or impl.

         constexpr T&& value_or()&& {
            if (!_has_value)
               return std::move(T());
            _has_value = false;
            return std::move(_get());
         }
         constexpr const T&& value_or()const&& {
            if (!_has_value)
               return std::move(T());
            _has_value = false;
            return std::move(_get());
         }
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

No branches or pull requests

1 participant