So here is the solution:

#include <bits/stdc++.h>
 
struct A {
    void fn_a() {}
};
 
struct B {
    void fn_b() {}
};
 
struct C : A, B {
 
};
 
template<typename T, typename... Ts>
concept PointerInheritsFrom = std::is_pointer_v<T> && (std::is_base_of_v<Ts, std::remove_pointer_t<T>> && ...);
 
void call_stuff(PointerInheritsFrom<A, B> auto p) {
    p->fn_a();
    p->fn_b();
}
 
int main() {
    C z;
    call_stuff(&z);  
}
I think this is what you are looking for. 


On Fri, Nov 25, 2022, 16:29 Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org> wrote:


On Friday, November 25, 2022, Jason McKesson via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
There seems to be a broad lack of understanding of what this feature
is doing, probably due to unfamiliarity with the way the wxWidgets
library uses base classes.

wxWidgets uses multiple inheritance in a lot of cases. The two classes
in question, `wxControl` and `wxTextEntry` are both base classes. A
control that wants to have text entry functionality would inherit from
both, but it is also possible to have text entry objects that are not
controls and controls that don't have text entry functionality.

The goal of the proposal is to be able to write a function that takes
a single pointer to any type which inherits from *two or more* base
classes. And then use that pointer to access any function which is
available from any of these base classes.
<snip> 


Thanks James, you hit the nail on the head here. What you wrote is _exactly_ what I'm thinking.

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals