The declaration is true if you do not call f2 .
The compiler should not know the inner Result class unless you call f2 . The ad has no storage allocation.
If any compilation module calls f2 , you need to provide the full type for the Result class or you need another reference parameter to call f2 :
void another_f(SomeAlgoInterface& i, std::vector<Result>& results) { i.f2(results); }
source share