what is the difference by declaring and initialising a vector in cls isn't this not the same as in cls2? in cls I get an error but in cls2 this is valid
Don't put NULL as the second parameter. How do you know that NULL (basically just 0) is appropriate for initializing any T? Just leave the second parameter out and T will be initialized with the appropriate initializer. (In C++ we don't use NULL, anyway. Pre-C++11 we use 0; since then we use the keyword nullptr.)
As for your question, obviously the two aren't exactly the same. Only the second is allowed, although I don't know exactly why (since, although they aren't the same, they do seem essentially equivalent). Before the second version was allowed, we just used the ctor.
Note that a "complete" program is useful so people can easily run it by pressing the little gear symbol.