diff --git a/src/blackmisc/containerbase.h b/src/blackmisc/containerbase.h index ed9b7b1b8..7586938eb 100644 --- a/src/blackmisc/containerbase.h +++ b/src/blackmisc/containerbase.h @@ -86,7 +86,7 @@ namespace BlackMisc } /*! - * \brief Return true if there is an element for which a given predicate returns true + * \brief Return true if there is an element for which a given predicate returns true. */ template bool contains(Predicate p) const @@ -96,8 +96,6 @@ namespace BlackMisc /*! * \brief Return true if there is an element equal to given object - * \param object is this object in container? - * \return */ bool contains(const T &object) const { diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index f706e3c83..500fb4343 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -249,6 +249,7 @@ namespace BlackMisc /*! * \brief Remove elements for which a given predicate returns true. + * \pre The sequence must be initialized. */ template void removeIf(Predicate p) @@ -269,6 +270,7 @@ namespace BlackMisc /*! * \brief Remove the given object, if it is contained. + * \pre The sequence must be initialized. */ void remove(const T &object) { @@ -305,6 +307,7 @@ namespace BlackMisc /*! * \brief Replace elements for which a given predicate returns true. If there is no match, push the new element on the end. + * \pre The sequence must be initialized. */ template void replaceOrAdd(Predicate p, const T &replacement) @@ -315,6 +318,7 @@ namespace BlackMisc /*! * \brief Replace elements matching the given element. If there is no match, push the new element on the end. + * \pre The sequence must be initialized. */ void replaceOrAdd(const T &original, const T &replacement) { @@ -326,6 +330,7 @@ namespace BlackMisc * \brief Replace elements matching a particular key/value pair. If there is no match, push the new element on the end. * \param key1 A pointer to a member function of T. * \param value1 Will be compared to the return value of key1. + * \pre The sequence must be initialized. */ template void replaceOrAdd(K1 key1, V1 value1, const T &replacement)