proxy

Concept proxiable

template <class P, class F>
concept proxiable = /* see-below */;

The concept proxiable<P, F> specifies that proxy<F> can potentially contain a value of type P. For a type P, if P is an incomplete type, the behavior of evaluating proxiable<P, F> is undefined. proxiable<P, F> is true when F meets the ProFacade requirements of P; otherwise, it is false.

Example

#include <string>
#include <vector>

#include "proxy.h"

PRO_DEF_FREE_DISPATCH(FreeToString, std::to_string, ToString);

struct Stringable : pro::facade_builder
    ::add_convention<FreeToString, std::string()>
    ::build {};

int main() {
  static_assert(pro::proxiable<int*, Stringable>);
  static_assert(pro::proxiable<std::shared_ptr<double>, Stringable>);
  static_assert(!pro::proxiable<std::vector<int>*, Stringable>);
}

See Also