Quote Originally Posted by BlueAngelTC View Post
I'm a bit confused JohnW,
thank you for your reply but your code won't even compile.
Which compiler are you using? It compiles and runs fine on mine (Visual Studio 2008).

By the way, JohnW, there are two mistakes in your code, maybe you didn't notice:
The pure virtual destructor in Matrix have an (empy) implementation, it should only be declared.
Not exactly an error. It's just saying that you MUST override the destructor, but also defines the base destructor code. A bit pointless I know, as it doesn't actually do anything. It was just a leftover from my experiment. A pure virtual destructor, with a default implementation, is sometimes a valid thing to do.

Also ArrayMatrix cannot access to protected variables _righe and _colonne ("rows" and "columns" in English, sorry I left the names in Italian) directly, it must use the Matrix<T>:: sintax.
A derived class can access protected members of the class it's derived from. That's the difference between protected and private.