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

env and prop are relying on deprecated behavior #291

Open
ericniebler opened this issue Oct 14, 2024 · 0 comments
Open

env and prop are relying on deprecated behavior #291

ericniebler opened this issue Oct 14, 2024 · 0 comments
Labels
bug Something isn't working P1

Comments

@ericniebler
Copy link
Collaborator

In p3325r3, prop is defined with a deleted copy-assignment operator, as follows:

  template<class Query, class Value>
  struct prop {
    Query query;    // exposition only
    Value value;    // exposition only

    static_assert(see below);

    constexpr const Value& query(Query) const noexcept {
      return value;
    }

    prop& operator=(const prop&) = delete;
  };

  template<class Query, class Value>
  prop(Query, Value) -> prop<Query, unwrap_reference_t<Value>>;

This causes clang to issue the diagnostic:

definition of implicit copy constructor for 'prop<>' is deprecated because
it has a user-declared copy assignment operator

We can't "fix" the code by defining or defaulting a copy constructor; that would break aggregate initialization. I don't know what else to do in my own code except suppress the warning and hope the behavior is never removed.

@ericniebler ericniebler added bug Something isn't working P1 labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

No branches or pull requests

1 participant