TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: THOMAS MAEDER
from: BALOG PAL
date: 1997-07-03 08:35:00
subject: Visual C++ 4.0 or MFC bug

                             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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.