Used in the definition of a Poly interface to say that the current interface is an extension of a set of zero or more interfaces.
Declared in <folly/Poly.h>
template<class... I>
struct PolyExtends
: virtual I...
Example:
struct IFoo { template <class Base> struct Interface : Base { void foo() { folly::poly_call<0>(*this); } }; template <class T> using Members = FOLLY_POLY_MEMBERS(&T::foo); } struct IBar : PolyExtends<IFoo> { template <class Base> struct Interface : Base { void bar(int i) { folly::poly_call<0>(*this, i); } }; template <class T> using Members = FOLLY_POLY_MEMBERS(&T::bar); }
| Name | Description |
|---|---|
I... |
| Name | Description |
|---|---|
Interface | The interface mixin inherited by extending interfaces. |
| Name | Description |
|---|---|
Members | The (empty) member list contributed by this extension. |
Subsumptions | The list of interfaces this interface subsumes. |
| Name | Description |
|---|---|
IBooleanTestable | A Poly interface that can be used to make Poly objects contextually convertible to bool (true if and only if non-empty). It also gives Poly objects a unary logical negation operator. |
IEqualityComparable | A Poly interface for types that are equality comparable. |
IMoveOnly | A Poly interface for types that are move-only. |
INullablePointer | A Poly interface that can be used to make Poly objects initializable from nullptr (to create an empty Poly) and equality comparable to nullptr (to test for emptiness). |
IRegular | A Poly interface for types that are copyable, movable, and equality comparable. |
ISemiRegular | A Poly interface for types that are copyable and movable. |
IStrictlyOrderable | A Poly interface for types that are strictly orderable. |