Bug 31555 - stable_partition assumes iterator difference type is always ptrdiff_t
Summary: stable_partition assumes iterator difference type is always ptrdiff_t
Status: RESOLVED DUPLICATE of bug 31554
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.1.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-12 19:07 UTC by Dan Gohman
Modified: 2007-04-12 19:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Gohman 2007-04-12 19:07:58 UTC
Instantiating stable_partition with an iterator where the difference_type is
something different than ptrdiff_t results in an error like this:

.../bits/stl_algo.h: In function `_ForwardIterator std::stable_partition(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = my_iterator, _Predicate = bool (*)(double)]':
test.c:32:   instantiated from here
.../bits/stl_algo.h:2154: error: no matching function for call to `__stable_partition_adaptive(my_iterator&, my_iterator&, bool (*&)(double), short int, double*, ptrdiff_t)'

The __stable_parition_adaptive effectively requires the __len and __buffer_size arguments to have the same type, and stable_parition calls it with one of them always as ptrdiff_t.
Comment 1 Dan Gohman 2007-04-12 19:09:07 UTC

*** This bug has been marked as a duplicate of 31554 ***