Static template class member question

Say you have a class
1
2
3
4
5
template <typename T>
class foo {
private:
    static int bar;
};

Is bar shared between all objects of type foo, or is it grouped so that all objects of type foo<T1> share one bar and those of type foo<T2> share a different bar? If it's the same for all objects of type foo, regardless of T, then what about this:
1
2
3
4
5
template <typename T>
class foo {
private:
    static T bar;
};

?
Last edited on
foo<T1> is a different class than foo<T2>
Thanks.
Topic archived. No new replies allowed.