January 2011 Developer's Poll

Use this forum for polls.

What is your primary technique for managing arrays in your code?

(a) A VCL container class (e.g., TList)
14
21%
(b) A container class in the Standard C++ Library (e.g., std::vector)
25
37%
(c) A Boost container class (e.g., boost::multi_array)
2
3%
(d) Raw C++ arrays using new[]
24
36%
(e) Raw C arrays using malloc(), GlobalAlloc(), etc.
2
3%
(f) Other
0
No votes
 
Total votes : 67

January 2011 Developer's Poll

Postby Damon » Thu Feb 24, 2011 11:48 am

I recently had to use a raw C array to interface with an external library. What a pain is was!

For normal everyday coding, I tend to use std::vector. I also use a custom template class that internally calls new[], although it's probably time to update this class to use std::vector as well.

What about everyone else? (Please select your top two choices.)

Cheers,
Damon
Damon Chandler
Editor-in-Chief
C++Builder Developer's Journal
http://bcbjournal.com
User avatar
Damon
BCBJ Editor and Admin
BCBJ Editor and Admin
 
Posts: 285
Joined: Wed May 26, 2004 11:25 pm
Location: Stillwater, OK, USA

Re: January 2011 Developer's Poll

Postby djones » Thu Feb 24, 2011 1:41 pm

I typically use vectors, maps, and sometimes sets. However, occasionally, I do create raw arrays using new[], but I *always* immediately assign them to smart pointers, such as, boost::scoped_array or boost:shared_array. With so many good RAII classes available nowadays, managing memory by hand is just plain silly.

Dennis
djones
 
Posts: 6
Joined: Sun Dec 07, 2008 2:35 pm


Return to Polls

Who is online

Users browsing this forum: No registered users and 1 guest