Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SkiFire13
68 days ago
|
parent
|
context
|
favorite
| on:
Swapping two blocks of memory inside a larger bloc...
> But even with that constraint ... std::rotate allocates memory! It'll throw std::bad_alloc when it can't.
This feels kinda crazy. Is there a reason why this is the case?
quuxplusone
68 days ago
[–]
That's only for the parallel overload. The ordinary sequential overload doesn't allocate: the only three ordinary STL algorithms that allocate are stable_sort, stable_partition, and (ironically) inplace_merge.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
This feels kinda crazy. Is there a reason why this is the case?