Skip to content

LLVM16: Investigate removing cost from value_or #322

Open
@ericpassmore

Description

@ericpassmore

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());
         }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions