Skip to content

Document const bindings #50

@poletti-marco

Description

@poletti-marco

In some use cases of bindInstance, people might want to bind constants. To support this use case, the following changes are needed:

  • Change the normalization of const C, const C& and const C* to be const C (instead of C)
  • Forbid binding both const C and C (with tests)
  • When a const C binding is required, a C binding can satisfy this requirement (also add tests for this)
  • Add tests for bindInstance(const C&)
  • Document the caveat of bindInstance(const C&) (the reference must outlive the injector) and add a deleted bindInstance(C&&) overload to make sure temporaries are rejected.
  • Update comments and wiki to mention the new kind of binding, add examples to the reference documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions