Boost logo

Boost Users :

Subject: Re: [Boost-users] [container][slist] constant time splice_after
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-09-14 13:01:50


El 13/09/2014 12:06, Aaron Levy escribió:
> 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?

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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net