class IEditable {};
class EditableThing : public IEditable {};
class NonEditableThing {};
template
RegisterEditable( string name ) {
// If T derives from IEditable, add to a list; otherwise do nothing - possible?
}
int main() {
RegisterEditable( "EditableThing" ); // should add to a list
RegisterEditable( "NonEditableThing" ); // should do nothing
}
< /code>
Если у кого -то есть идеи, дайте мне знать!

Изменить: я должен добавить, я не хочу создавать /создавать заданный объект, чтобы проверить его тип. < /p>
Подробнее здесь: https://stackoverflow.com/questions/140 ... definition