Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename T>
- struct A {
- A(T &child)
- :
- child_ptr{&child} {}
- T &f() {
- return *(this->child_ptr);
- }
- T *child_ptr;
- };
- struct B : A<B> {
- B()
- :
- A{*this} {}
- void foo() {};
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement