Hi, Thomas Maeder!
On 29 Jun 97 16:18:00 you wrote to Balog Pal
BP> CObject * foo = new CObject;
BP> will not compile as the only ctor is protected.
BP> Then the question: is it legal to create an array as I did above? Th
TM> No. Each element of a dynamically allocated array is initialized using
TM> the default constructor; if the default constructor isn't accessible,
TM> you're not allowed to dynamically allocate an array.
BP> compiles without even a warning and that protected ctor is simply ca
TM> Look for a better compiler.
Yeah. :-(( I tried the same code with VC 5.0. It's correct. The delete now
works as needed and the above array creation generates the appropriate error.
Paul
... Brain on vacation, penis on autopilot
--- OS/2 Warp
---------------
* Origin: The FlintStones' Cave in BedRock (2:371/20)
|