Original Post
Hello, I have a question regarding templates. Is it possible to restrict the types used in tempalate classes? IE I want a function: template getMyObject() { ... return (T)myObject }; myObject is stored as a base type, and I want it to be cast to my type T. But I need to make sure that the cast won't fail... Is there a way to limit the arguments into the tempalte type or is this better to do some kind of dynamic_cast checking?