libcamera: utils: Add reverse adapter for range-based loop
Add a utils::reverse() function that creates an adapter wrapping in iterable, such that range-based iteration over the adapter iterates over the iterable in reverse order. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -464,6 +464,14 @@ std::string libcameraSourcePath()
|
||||
* \return The value rounded up to the nearest multiple of \a alignment
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn reverse(T &&iterable)
|
||||
* \brief Wrap an iterable to reverse iteration in a range-based loop
|
||||
* \param[in] iterable The iterable
|
||||
* \return A value of unspecified type that, when used in a range-based for
|
||||
* loop, will cause the loop to iterate over the \a iterable in reverse order
|
||||
*/
|
||||
|
||||
} /* namespace utils */
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user