I have two classes, let's call them SomeClass and OtherClass.
SomeClass Templates:
template <typename T> class SomeClass
{
public:
SomeClass (const T& value);
};
OtherClass is not a template, but uses SomeClass.
class OtherClass
{
public:
OtherClass (const SomeClass& c, const std::string s);
};
They should be called as follows:
SomeClass<int> some(5);
OtherClass other(some, "hello, world!");
other.doSomethingWithSome();
... Obviously, this does not compile, since the compiler must know the type of SomeClass ...
Unfortunately, for me, the SomeClass type can be almost anything (although the number of actual types used is limited, it is simply not related) and can often change during development. (I know, I know, I believe that I could really use the SomeClass type and pass it to the templated OtherClass, but its pretty tedious work, as there are a few examples, I would also like to pretend that no class knows about other jobs.:))
: ? ( templatize OtherClass.)