Previously, I've added an additional '&' to be able
to pass references without much ado. This turned out
to be problematic when using constant values at the
invocation site. Well. C++ has really a fixation
ont passing things by value. This is fine, but
doesn't play so well at times when passing smart-ptrs
or similar ref-counting stuff, especially when we just
want to *use* the handle, not store it away.
Essentially the same situation as with for_each
Bottom line: from now on, we need to state the
template parameter for such arguments explicitly,
or just accept the overhead of creating an additional
transient copy of the smart-ptr.
Using a policy based switch in case the client
interface collaborates and provides copy operations;
in this case, a direct static downcast instead of
the expensive indirect (dynamic) cast to the
management interface can be employed.