Skip to content

Support for base class of derived types #9

@randomizedthinking

Description

@randomizedthinking

Understand that proxy is for member functions, but not member variables. Yet, in practice, there is a common theme of using proxy for T types derived from a common TBase.

class T : public TBase {};

pro::proxy<Facade, T> proxy;

Is there any way that proxy can accommodate such a pattern? For instance, define a new class with_base_class for the facade_builder.

struct Facade
    : pro::facade_builder
      ::with_base_class<TBase>
      ::build {};

pro::proxy<Facade, T> proxy;  // T is ensured to derived from TBase
proxy.base()->memvar;          // proxy.base() would return the pointer to TBase

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions