Click here to Skip to main content
16,005,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMAPI/CDO from an NT Service Pin
thowra8-Oct-03 0:35
thowra8-Oct-03 0:35 
GeneralRe: MAPI/CDO from an NT Service Pin
Xiangyang Liu 刘向阳8-Oct-03 2:25
Xiangyang Liu 刘向阳8-Oct-03 2:25 
GeneralSelecting Position in CListCtrl Pin
Chernobog18-Oct-03 0:23
Chernobog18-Oct-03 0:23 
GeneralRe: Selecting Position in CListCtrl Pin
Anthony_Yio8-Oct-03 1:30
Anthony_Yio8-Oct-03 1:30 
GeneralRe: Selecting Position in CListCtrl Pin
Roger Allen8-Oct-03 1:47
Roger Allen8-Oct-03 1:47 
GeneralRe: Selecting Position in CListCtrl Pin
ohadp8-Oct-03 2:49
ohadp8-Oct-03 2:49 
GeneralRe: Selecting Position in CListCtrl Pin
Chernobog18-Oct-03 4:08
Chernobog18-Oct-03 4:08 
QuestionPlease suggest: placement new or not? Pin
peterchen8-Oct-03 0:21
peterchen8-Oct-03 0:21 
Hi,

I have to bite the bullet and provide a custom container class*

Broken down, here's my question:
Assume a typical array implementation with size/reserve mechanism, or an allocation granularity.

if the vector contains classes is it better to

a) allocate the "additional" elements the normal way, thus calling the default constructor immediately even for the currently unused elements
b) allocate "dumb" memory, and call the constructor explicitely (using placement new) only when an element gets into use.

(a) has lesser complexity, and less pitfalls.
OTOH, (b) is closer to a "simple containter", in that it calls only the constructor of elements that are really used (better encapsulation of the preallocation mechanism), and it might perform better in an reserve-and-append scenario: data can be appended in one pass calling copy constructors, rather than two passes (1st pass default CTor, 2nd pass assignment operator).

Comments? Ideas? Experiences?




*) STL is out for several reasons, and this time it's not because I hate STL


"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."

sighist | Agile Programming | doxygen

AnswerRe: Please suggest: placement new or not? Pin
cmk8-Oct-03 9:41
cmk8-Oct-03 9:41 
General100% CPU Usage problem Pin
samhita7-Oct-03 23:58
samhita7-Oct-03 23:58 
GeneralRe: 100% CPU Usage problem Pin
Johnny ²8-Oct-03 1:07
Johnny ²8-Oct-03 1:07 
QuestionHow to fit into a paper when printing Pin
vancouver7777-Oct-03 23:42
vancouver7777-Oct-03 23:42 
QuestionInclude for IID's ? Pin
Bernhard7-Oct-03 23:36
Bernhard7-Oct-03 23:36 
AnswerRe: Include for IID's ? Pin
jmkhael8-Oct-03 0:30
jmkhael8-Oct-03 0:30 
GeneralRe: Include for IID's ? Pin
Bernhard8-Oct-03 1:26
Bernhard8-Oct-03 1:26 
GeneralRe: Include for IID's ? Pin
David Crow8-Oct-03 2:47
David Crow8-Oct-03 2:47 
AnswerRe: Include for IID's ? Pin
Anand Paranjpe8-Oct-03 0:30
Anand Paranjpe8-Oct-03 0:30 
GeneralPrinting the dialog box Pin
venkyhyd7-Oct-03 23:26
venkyhyd7-Oct-03 23:26 
GeneralRe: Printing the dialog box Pin
David Crow8-Oct-03 2:49
David Crow8-Oct-03 2:49 
QuestionHow to print from the Dialog Box? Pin
venkyhyd7-Oct-03 23:23
venkyhyd7-Oct-03 23:23 
GeneralCompiling errors Pin
FlyingDancer7-Oct-03 22:51
FlyingDancer7-Oct-03 22:51 
GeneralRe: Compiling errors Pin
Mike Dimmick7-Oct-03 23:11
Mike Dimmick7-Oct-03 23:11 
GeneralRe: Compiling errors Pin
FlyingDancer8-Oct-03 0:34
FlyingDancer8-Oct-03 0:34 
GeneralRe: Compiling errors Pin
Anand Paranjpe7-Oct-03 23:29
Anand Paranjpe7-Oct-03 23:29 
GeneralRe: Compiling errors Pin
FlyingDancer8-Oct-03 0:42
FlyingDancer8-Oct-03 0:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.