Click here to Skip to main content
15,916,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to use CListCtrl with CImageList? Pin
Naveen31-May-07 18:03
Naveen31-May-07 18:03 
QuestionRe: How to use CListCtrl with CImageList? Pin
Hamid_RT31-May-07 18:27
Hamid_RT31-May-07 18:27 
AnswerRe: How to use CListCtrl with CImageList? Pin
whiteclouds4-Jun-07 15:41
whiteclouds4-Jun-07 15:41 
QuestionC++ reference continued Pin
C_Zealot31-May-07 13:02
C_Zealot31-May-07 13:02 
AnswerRe: C++ reference continued Pin
Christian Graus31-May-07 13:29
protectorChristian Graus31-May-07 13:29 
GeneralRe: C++ reference continued Pin
Stephen Hewitt31-May-07 14:26
Stephen Hewitt31-May-07 14:26 
GeneralRe: C++ reference continued Pin
Christian Graus31-May-07 18:28
protectorChristian Graus31-May-07 18:28 
GeneralRe: C++ reference continued Pin
Stephen Hewitt31-May-07 18:57
Stephen Hewitt31-May-07 18:57 
Christian Graus wrote:
That's a matter of opinion. I've worked on code that contained a ton of STL containers, all typedefed, and it was plain illegible.

In the end almost anything can be considered a matter of opinion, but I’ll explain some instances in which typedefs can be useful. A STL std::set looks something like this:
template <class _K, class _Pr = less<_K>, class _A = allocator<_K> >
class set;

If we have one of these beasts where we’ve made explicit use of all three template arguments we’d have to specify the whole long type in every use. A simple typedef with a descriptive name eliminates all this. Surely this is a simplification, especially since some of the arguments are implementation details. Say, at a later stage, we make a design decision to change the allocator used: we would have to go through the code and change all uses of the type. If a typedef is used we can make the change in one place. This is an example of the general design principle that, if possible, a single design decision should be expressed in a single place (or as few places as possible). Another example is generic programming; STL containers use typedefs with standard names to expose implementation dependent types in a standard manner which enables uniform usage despite the differences.

Steve

AnswerRe: C++ reference continued Pin
Mark Salsbery31-May-07 14:08
Mark Salsbery31-May-07 14:08 
GeneralRe: C++ reference continued Pin
C_Zealot31-May-07 14:29
C_Zealot31-May-07 14:29 
AnswerRe: C++ reference continued Pin
Jeffrey Walton31-May-07 20:39
Jeffrey Walton31-May-07 20:39 
GeneralCTreeCtrl - GetSelectedItem [modified] Pin
Vaclav_31-May-07 12:26
Vaclav_31-May-07 12:26 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Naveen31-May-07 15:24
Naveen31-May-07 15:24 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Vaclav_31-May-07 15:55
Vaclav_31-May-07 15:55 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Naveen31-May-07 16:01
Naveen31-May-07 16:01 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Vaclav_31-May-07 16:28
Vaclav_31-May-07 16:28 
QuestionErrors? C++, play with reference Pin
C_Zealot31-May-07 11:55
C_Zealot31-May-07 11:55 
AnswerRe: Errors? C++, play with reference Pin
Mark Salsbery31-May-07 12:13
Mark Salsbery31-May-07 12:13 
GeneralRe: Errors? C++, play with reference Pin
C_Zealot31-May-07 12:16
C_Zealot31-May-07 12:16 
QuestionVC++ 6 -warpper Pin
Tal S.31-May-07 9:54
Tal S.31-May-07 9:54 
AnswerRe: VC++ 6 -warpper Pin
Matthew Faithfull31-May-07 10:06
Matthew Faithfull31-May-07 10:06 
AnswerRe: VC++ 6 -warpper Pin
Chris Losinger31-May-07 10:43
professionalChris Losinger31-May-07 10:43 
AnswerRe: VC++ 6 -warpper Pin
Hamid_RT31-May-07 18:27
Hamid_RT31-May-07 18:27 
Questionconverting from const char [] to 'LPWSTR' Pin
maizhiming31-May-07 9:28
maizhiming31-May-07 9:28 
AnswerRe: converting from const char [] to 'LPWSTR' Pin
Matthew Faithfull31-May-07 9:43
Matthew Faithfull31-May-07 9:43 

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.