Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVC .NET 2003 Serial Port Comms Pin
shultas6-Mar-04 5:39
shultas6-Mar-04 5:39 
GeneralRe: VC .NET 2003 Serial Port Comms Pin
bishbosh027-Mar-04 8:45
bishbosh027-Mar-04 8:45 
Generaliterator Pin
nss6-Mar-04 4:41
nss6-Mar-04 4:41 
GeneralRe: iterator Pin
Michael Dunn6-Mar-04 5:02
sitebuilderMichael Dunn6-Mar-04 5:02 
GeneralRe: iterator Pin
nss6-Mar-04 5:44
nss6-Mar-04 5:44 
GeneralRe: iterator Pin
Jörgen Sigvardsson6-Mar-04 14:31
Jörgen Sigvardsson6-Mar-04 14:31 
GeneralRe: iterator Pin
Nemanja Trifunovic6-Mar-04 15:06
Nemanja Trifunovic6-Mar-04 15:06 
GeneralRe: iterator Pin
Jörgen Sigvardsson6-Mar-04 15:16
Jörgen Sigvardsson6-Mar-04 15:16 
Yes, you are right. I thought forward iterator would be ok. I guess one will have to use std::advance instead then. But I'll have to copy the iterator, as std::advance mutates the iterator (passed by reference) Hmmm | :|

But I guess one could always do
template <typename Iterator, typename Distance>
Iterator my_advance(const Iterator& i, Distance d) {
    Iterator tmp = i;
    std::advance(tmp, d);
    return tmp;
}
and then
*I = *(my_advance(I, 1));
If the compiler is smart and inlines the function, there's no overhead penalty.

--
Unser Tanz ist so wild! Ein neuer böser Tanz.
Alle gegen Alle!

QuestionWhat does this mean? Pin
Link26005-Mar-04 21:18
Link26005-Mar-04 21:18 
AnswerRe: What does this mean? Pin
Prakash Nadar5-Mar-04 21:36
Prakash Nadar5-Mar-04 21:36 
AnswerRe: What does this mean? Pin
Roger Wright6-Mar-04 4:16
professionalRoger Wright6-Mar-04 4:16 
AnswerRe: What does this mean? Pin
Michael Dunn6-Mar-04 5:04
sitebuilderMichael Dunn6-Mar-04 5:04 
GeneralRe: What does this mean? Pin
Roger Wright6-Mar-04 5:09
professionalRoger Wright6-Mar-04 5:09 
GeneralRe: What does this mean? Pin
Prakash Nadar6-Mar-04 5:12
Prakash Nadar6-Mar-04 5:12 
GeneralRe: What does this mean? Pin
Roger Wright6-Mar-04 11:53
professionalRoger Wright6-Mar-04 11:53 
GeneralRe: What does this mean? Pin
Michael Dunn6-Mar-04 5:20
sitebuilderMichael Dunn6-Mar-04 5:20 
GeneralRe: What does this mean? Pin
Roger Wright6-Mar-04 5:28
professionalRoger Wright6-Mar-04 5:28 
GeneralLinker error Pin
Anthony_Yio5-Mar-04 20:43
Anthony_Yio5-Mar-04 20:43 
GeneralRe: Linker error Pin
Anthony_Yio5-Mar-04 22:14
Anthony_Yio5-Mar-04 22:14 
QuestionCan You Help With This? Pin
GameBoy™5-Mar-04 16:07
GameBoy™5-Mar-04 16:07 
AnswerRe: Can You Help With This? Pin
Prakash Nadar5-Mar-04 16:27
Prakash Nadar5-Mar-04 16:27 
AnswerRe: Can You Help With This? Pin
annum6-Mar-04 7:47
annum6-Mar-04 7:47 
Generalprogram optimization Pin
(Steven Hicks)n+15-Mar-04 15:03
(Steven Hicks)n+15-Mar-04 15:03 
GeneralRe: program optimization Pin
valikac5-Mar-04 16:03
valikac5-Mar-04 16:03 
GeneralRe: program optimization Pin
Prakash Nadar5-Mar-04 16:25
Prakash Nadar5-Mar-04 16:25 

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.