Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -215,10 +215,17 @@ * @return An initialized OFArray */ - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; +/** + * @brief Returns an OFEnumerator to enumerate through all objects of the array. + * + * @return An OFEnumerator to enumerate through all objects of the array + */ +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; + /** * @brief Returns the object at the specified index in the array. * * @warning The returned object is *not* retained and autoreleased for * performance reasons! Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -22,10 +22,14 @@ /** * @protocol OFEnumeration OFEnumerator.h ObjFW/OFEnumerator.h * * @brief A protocol for getting an enumerator for the object. + * + * If the class conforming to OFEnumeration is using lightweight generics, the + * only method, @ref objectEnumerator, should be overridden to use lightweight + * generics. */ @protocol OFEnumeration /** * @brief Returns an OFEnumerator to enumerate through all objects of the * collection. Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -161,10 +161,17 @@ * @return An initialized set with the specified object and va_list */ - (instancetype)initWithObject: (ObjectType)firstObject arguments: (va_list)arguments; +/** + * @brief Returns an OFEnumerator to enumerate through all objects of the set. + * + * @return An OFEnumerator to enumerate through all objects of the set + */ +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; + /** * @brief Returns whether the receiver is a subset of the specified set. * * @return Whether the receiver is a subset of the specified set */