This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi,I have it now.
Do you have n3126 at hand? Please fetch it from the ISO web site, if you
didn't already.
Yes, end and before begin looks similar. However, with current libstdc++ implementation there is a major difference. end has no relation with the forward list but before begin is tighly link to it with no way to associate it with any other forward list instance.I see that 23.2.1/11 explicitly says that swap can invalidate end(), I wonder if it should explicitly say something similar about before_begin?!? After all, aren't the two otherwise very similar? What do you think?
Because, really, that looping, etc, part of swapI agree that it is not something you would expect in a swap implementation. At least not in the normal form and the whole Standard is written in such a way that swap is easy to write in a performant way. However the safe mode is not Standard and it is not surprising that as long as you keep links between iterators and sequences then some operations become more difficult to implement.
seems just crazy to me: it's a very, very basic design idea in the
standard (even more now in the move semantics era) that swap is a very
fast constant time operation, is just about exchanging a few pointers.
If we cannot manage to implement it like that, either the standard
should be slightly tweaked somewhere, or... we should try harder ;)
Attachment:
ChangeLog.entry
Description: Text document
Attachment:
forward_list.patch
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |