Skip to content

Add utilities for std::reference_wrapper

Carsten Gräser requested to merge feature/referencehelper into master

This adds the following helpers for handling std::reference_wrapper:

  • A predicate IsReferenceWrapper_v<R> for detecting if R is a std::reference_wrapper<T>.
  • A helper function resolveRef for resolving references wrapped in std::reference_wrapper. For type T providing a method T::foo() this allows to transparently use resolveRef(t).foo() if t is either a plain T or a std::reference_wrapper<T>.
  • A type alias ResolveRef_t<T> to determine the resolved type for T.

Merge request reports

Loading