#include <iostream>

struct widget
{
	struct bar { explicit bar(int) { std::cout << "constructor\n"; } };

	void bar(int) { std::cout << "function\n"; }
};

template<class B>
struct gadget : B
{
	void a() { typename B::bar(10); }
	void b() { B::bar(10); }
};

int main()
{
	gadget<widget> x;
	x.a();
	x.b();
}