Click here to Skip to main content
15,886,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How Do display a Name in place of SMS sender phone no using AT Commands? Pin
Le@rner21-Feb-10 18:20
Le@rner21-Feb-10 18:20 
GeneralRe: How Do display a Name in place of SMS sender phone no using AT Commands? Pin
m_k_b_h14-Jul-11 0:02
m_k_b_h14-Jul-11 0:02 
QuestionSecondary Desktop Pin
trioum19-Feb-10 21:11
trioum19-Feb-10 21:11 
AnswerRe: Secondary Desktop Pin
Richard MacCutchan20-Feb-10 0:38
mveRichard MacCutchan20-Feb-10 0:38 
GeneralRe: Secondary Desktop Pin
Maximilien20-Feb-10 1:53
Maximilien20-Feb-10 1:53 
GeneralRe: Secondary Desktop Pin
trioum20-Feb-10 21:44
trioum20-Feb-10 21:44 
AnswerRe: Secondary Desktop Pin
WoutL20-Feb-10 2:32
WoutL20-Feb-10 2:32 
QuestionRepeat a typedef or include a header with the typedef? Pin
asincero19-Feb-10 13:22
asincero19-Feb-10 13:22 
Suppose I have the following:

(in class_a.h):
class Foo;
class ClassA
{
public:
     typedef std::vector< boost::shared_ptr<Foo> > Foos;
     Foos makeFoos() const;

};


and in another class, I have a method that makes use of a vector of
Foos. Should I do this:

(Try #1, class_b.h):
#include "class_a.h"

class ClassB
{
public:
     void useFoos(const ClassA::Foos& foos);

};


or just repeat the typedef in class_b.h like this:

(Try #2, class_b.h):
class Foo;
class ClassB
{
public:
     typedef std::vector< boost::shared_ptr<Foo> > Foos;
     void useFoos(const Foos& foos);

};


Try #1 seems bad because it creates a dependency between class_a.h and
class_b.h when all I want is the typedef for Foos. Try #2 repeats the
typedef, so it seems like I'm repeating code which also seems bad, but
not as bad as Try #1. Repeating typedefs also becomes less attractive
when the thing I'm typedef'ing is non-trivial.

Perhaps I should I break out the Foos typedef into it's own header (perhaps
the header file for class Foo?) and have both class_a.h and class_b.h
include that?

Thanks!

-- Arcadio
AnswerRe: Repeat a typedef or include a header with the typedef? Pin
«_Superman_»19-Feb-10 15:35
professional«_Superman_»19-Feb-10 15:35 
AnswerRe: Repeat a typedef or include a header with the typedef? Pin
cmk20-Feb-10 12:21
cmk20-Feb-10 12:21 
QuestionKeyBoard Hook Pin
devidmorton19-Feb-10 9:22
devidmorton19-Feb-10 9:22 
AnswerRe: KeyBoard Hook [modified] Pin
Abhi Lahare19-Feb-10 10:05
Abhi Lahare19-Feb-10 10:05 
GeneralRe: KeyBoard Hook [modified] Pin
devidmorton20-Feb-10 8:31
devidmorton20-Feb-10 8:31 
GeneralRe: KeyBoard Hook Pin
Abhi Lahare22-Feb-10 5:13
Abhi Lahare22-Feb-10 5:13 
QuestionFast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Kiran Satish19-Feb-10 9:05
Kiran Satish19-Feb-10 9:05 
AnswerRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Chris Losinger19-Feb-10 12:09
professionalChris Losinger19-Feb-10 12:09 
AnswerRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Jonathan Davies20-Feb-10 1:17
Jonathan Davies20-Feb-10 1:17 
GeneralRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Stephen Hewitt20-Feb-10 3:33
Stephen Hewitt20-Feb-10 3:33 
GeneralRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Kiran Satish20-Feb-10 11:05
Kiran Satish20-Feb-10 11:05 
GeneralRe: Fast and efficeint way to rotate a bitmap at integer multiples of 90°?? Pin
Jonathan Davies20-Feb-10 11:30
Jonathan Davies20-Feb-10 11:30 
QuestionList of installed applications (as shown by "Open With" dialog box of windows.) Pin
Aseem Sharma19-Feb-10 1:10
Aseem Sharma19-Feb-10 1:10 
AnswerRe: List of installed applications (as shown by "Open With" dialog box of windows.) Pin
KingsGambit19-Feb-10 2:10
KingsGambit19-Feb-10 2:10 
AnswerRe: List of installed applications (as shown by "Open With" dialog box of windows.) Pin
fat_boy19-Feb-10 2:40
fat_boy19-Feb-10 2:40 
AnswerRe: List of installed applications (as shown by "Open With" dialog box of windows.) Pin
David Crow19-Feb-10 4:00
David Crow19-Feb-10 4:00 
QuestionConfusion Pin
john563218-Feb-10 23:41
john563218-Feb-10 23:41 

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.