Usually static members/objects of one class are the same for each instance of the class having the static member/object. Anyways what about if the static object is part of a template class and also depends on the template argument? For example, like this:
template<class T>
class A{
public:
static myObject<T> obj;
}
If I would cast one object of A as int
and another one as float
, I guess there would be two obj
, one for each type?
If I would create multiple objects of A as type int
and multiple float
s, would it still be two obj
instances, since I am only using two different types?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…