It depends on whether the coupling can be be decided at compile time or must be delayed until runtime.
If the coupling between a component and its dependencies is decided permanently at compile time, you can use templates. The compiler will then be able to perform inlining.
If however the coupling needs to be decided at runtime (e.g. the user chooses which other component will supply the dependency, perhaps through a configuration file) then you can't use templates for that, and you must use a runtime polymorphic mechanism.If so, your choices include virtual functions, function pointers orstd::tr1::function