Hello all,

I'm attempting to use a templated function to simplify my code. Basically, the function will look at plugins that are loaded, dynamic_cast them to see what kind of plugins they are (they all share a basic interface), then stuff them into a list that is appropriate for the type of plugin.

It appears, at least with gcc v4.1.2, that dynamic_cast does not work with templates. For example, I have a base class plugin, and a pluginInput class derived from plugin (and pluginInput is the actual plugin interface that QPluginLoader returns... I step it back to plugin to store them all together).

So now, I have a plugin that correctly associates all its function calls (getName(), etc), and definately is of type pluginInput... but dynamic_cast <T *>(myPlugin) always returns 0 (with T being pluginInput). Is there a way around this? I don't want to static_cast because I don't currently have the capability to tell for certain what kind of plugin it is (which is why I use dynamic_cast).