Opened 16 years ago
Closed 12 years ago
#816 closed Support Requests (fixed)
duplicat initial members -> erase_key postcond. fail
| Reported by: | cppljevans | Owned by: | Aleksey Gurtovoy |
|---|---|---|---|
| Milestone: | Boost 1.46.0 | Component: | mpl |
| Version: | None | Severity: | Problem |
| Keywords: | Cc: | agurtovoy@… |
Description (last modified by )
has_key<erase_key<set<T,T>,T>::type>type::value==true in violation of Postcondition on http://www.boost.org/libs/mpl/doc/refmanual/erase-key.html .
Attachments (2)
Change History (7)
comment:2 by , 15 years ago
| Component: | None → mpl |
|---|---|
| Description: | modified (diff) |
| Severity: | → Problem |
by , 13 years ago
| Attachment: | assoc_by_insert.cpp added |
|---|
solution using superclass which is fold over insert op
comment:3 by , 13 years ago
The previous comment referring to assoc_item was from:
https://sourceforge.net/tracker/?func=detail&atid=207586&aid=1642614&group_id=7586
The recent assoc_by_insert.cpp attachment shows simpler solution which folds over the set insert operation instead of the set s_item operation in the superclass of set<T1,T2,...,Tn> The reason it works is because the fold starts from the empty set, which has no duplicates, and the insert operation preserves the no duplicate invariant.
comment:4 by , 13 years ago
The just attached set.rst is another solution which just adds a warning to the docs.
This set.rst is a replacement for that in libs/mpl/doc/src/refmanual/set.rst.
comment:5 by , 12 years ago
| Cc: | added |
|---|---|
| Milestone: | → Boost 1.46.0 |
| Resolution: | None → fixed |
| Status: | assigned → closed |
Added a corresponding note and example to the docs.
