1 #include <fruit/fruit.h> 2 3 struct X { 4 INJECT(X()) = default; 5 }; 6 getXComponent()7 fruit::Component<X> getXComponent() { 8 return fruit::createComponent(); 9 } 10 main()11 int main() { 12 fruit::Injector<X> injector(getXComponent); 13 injector.get<X*>(); 14 } 15