[container][slist] constant time splice_after

13 Sep
2014
13 Sep
'14
10:06 a.m.
What happens if I call slist::splice_after(this_iter, that_list, that_begin, that_end, nelems) with an nelems value that does not match std::distance(that_begin, that_end). In other words, is there any kind of validations performed on nelems and is it just used to update the size of the list? Aaron

14 Sep
14 Sep
5:01 p.m.
El 13/09/2014 12:06, Aaron Levy escribió:
No. In Debug mode, I think the implementation does the check, but any check in runtme would invalidate the aim of the functions, which is O(1) splice. is nelems != std::distance(that_begin, that_end), then it's undefined behaviour. The documentation says this in the "Requires" clause, if the prerequisites are not met, then there is no guarantee. Best Ion
3884
Age (days ago)
3885
Last active (days ago)
1 comments
2 participants
participants (2)
-
Aaron Levy
-
Ion Gaztañaga