Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: (?) about STL Pin
Ian Darling13-Dec-03 10:28
Ian Darling13-Dec-03 10:28 
GeneralRe: (?) about STL Pin
Ian Darling13-Dec-03 11:12
Ian Darling13-Dec-03 11:12 
QuestionHow to find item or string in ListCtrl Pin
vss11113-Dec-03 10:10
vss11113-Dec-03 10:10 
AnswerRe: How to find item or string in ListCtrl Pin
Ravi Bhavnani13-Dec-03 10:48
professionalRavi Bhavnani13-Dec-03 10:48 
GeneralXP look on dialog controls Pin
Genije13-Dec-03 9:41
Genije13-Dec-03 9:41 
GeneralDetermining the type of a member variable Pin
Anonymous13-Dec-03 9:22
Anonymous13-Dec-03 9:22 
GeneralRe: Determining the type of a member variable Pin
#realJSOP13-Dec-03 9:36
mve#realJSOP13-Dec-03 9:36 
GeneralRe: Determining the type of a member variable Pin
Ian Darling13-Dec-03 10:12
Ian Darling13-Dec-03 10:12 
Given that in this case all you want to do is swap the member, why not call swap on that? The nice part about this is that it requires at compile time that what you pass into swap_x_with_y has an x and y member variable. The realswap function will happily just swap over whatever you give it, providing they are the same type.

template<class T> swap_x_with_y(T &v)
{
  realswap(v.x, v.y);
}

template<class T> realswap(T &x, T&y)
{
 T t = x;
 x = y;
 y = t;
}


--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
Generalcapture output Pin
thes3cr3t113-Dec-03 8:53
thes3cr3t113-Dec-03 8:53 
GeneralRe: capture output Pin
BaldwinMartin13-Dec-03 9:05
BaldwinMartin13-Dec-03 9:05 
GeneralRe: capture output Pin
thes3cr3t113-Dec-03 9:29
thes3cr3t113-Dec-03 9:29 
QuestionRegistry Question ? Pin
BaldwinMartin13-Dec-03 8:47
BaldwinMartin13-Dec-03 8:47 
AnswerRe: Registry Question ? Pin
BaldwinMartin13-Dec-03 14:40
BaldwinMartin13-Dec-03 14:40 
GeneralPutting a view in a dialog box Pin
#realJSOP13-Dec-03 8:37
mve#realJSOP13-Dec-03 8:37 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 9:17
BaldwinMartin13-Dec-03 9:17 
GeneralRe: Putting a view in a dialog box Pin
#realJSOP13-Dec-03 9:32
mve#realJSOP13-Dec-03 9:32 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 9:36
BaldwinMartin13-Dec-03 9:36 
GeneralRe: Putting a view in a dialog box Pin
#realJSOP13-Dec-03 9:57
mve#realJSOP13-Dec-03 9:57 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 10:10
BaldwinMartin13-Dec-03 10:10 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 10:22
BaldwinMartin13-Dec-03 10:22 
GeneralRe: Putting a view in a dialog box Pin
#realJSOP13-Dec-03 10:44
mve#realJSOP13-Dec-03 10:44 
GeneralRe: Putting a view in a dialog box Pin
Michael Dunn13-Dec-03 11:06
sitebuilderMichael Dunn13-Dec-03 11:06 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 14:42
BaldwinMartin13-Dec-03 14:42 
GeneralRe: Putting a view in a dialog box Pin
v_srinu_26_f14-Dec-03 8:55
v_srinu_26_f14-Dec-03 8:55 
QuestionHow to Create Tiff Image from CDC.... Pin
Sumit Kapoor13-Dec-03 5:21
Sumit Kapoor13-Dec-03 5:21 

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.