0

Assume:

struct A {
    int foo(int x);
}

template<typename X>
struct B {
    int foo(int x);

    static_assert(B::foo has same sig as X::foo)
}

B<A> trigger check 

Basically, I want to define an archetype struct and then concept check whether a given concrete struct has the same members.

Thanks!

user3612643
  • 5,096
  • 7
  • 34
  • 55
  • Check if the first class [has a member function with the desired signature](http://stackoverflow.com/q/87372/1362568). Do the same for the second class. You want both answers to be "Yes". – Mike Kinghan Feb 18 '17 at 08:41
  • Possible duplicate of [Check if a class has a member function of a given signature](http://stackoverflow.com/questions/87372/check-if-a-class-has-a-member-function-of-a-given-signature) – Mike Kinghan Feb 18 '17 at 08:44
  • I don't want to repeat the signature – user3612643 Feb 18 '17 at 09:13
  • Concepts... Have you tried the [Boost Concept Check Library](http://www.boost.org/doc/libs/1_63_0/libs/concept_check/concept_check.htm) or [Tick](https://github.com/pfultz2/Tick)? – kennytm Feb 18 '17 at 13:32

0 Answers0