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] | |
Personally, again, my only very serious concern is binary compatibility,
due to the additional storage of the size, which in any case will delay
this kind of change to the next library ABI. Otherwise, I would
certainly not resist to compelling evidence from actual usage that O (1)
is a must and much more important than splice.
By the way, in my opinion Matt has a very good point that a size, in
principle, could be always *added* in user code, outside std::list
proper. I think that option overall leads to a third set of trade- offs.
It would be nice if a paper summarizing the issue could also compare to
that option (i.e., would be: O(N) size, O(1) size, O(N) size + external
size).
list& operator=(const list&); iterator assign(iterator, iterator); // forward or better void assign(size_type, const T&);
void splice(iterator position, list& x, iterator first, iterator last, size_type n); // must be O(1)
is a better compromise. I also realize that it *is* a compromise, and not a 100% solution.
Well, somehow I like it, but certainly I find it "weird", don't know how
to better explain. I don't think there is something similar elsewhere in
the library: a quantity that the library could compute by itself and is
instead passed by the user with the requirement that must be consistent
with what the library would compute. Weird! ;)
basic_string(const charT* s); basic_string(const charT* s, size_type n);
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |