From 58cc126defe4528ba171c812fd7544027190175e Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Thu, 2 Mar 2017 22:41:29 +0800 Subject: Doc: Replace std::bind() with lambdas in Qt Concurrent Lambda functions provide all the benefits of std::bind() plus more Change-Id: Iec30b20bb35ac0fae560435b323f80af2f2e5fce Reviewed-by: Olivier Goffart (Woboq GmbH) --- .../doc/snippets/code/src_concurrent_qtconcurrentmap.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp') diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp index 91e76be0db..183b82bb9a 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp @@ -158,19 +158,11 @@ QImage QImage::scaledToWidth(int width, Qt::TransformationMode) const; //! [10] -//! [11] -std::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation) -//! [11] - - -//! [12] -QImage scaledToWith(const QImage &image) -//! [12] - - //! [13] QList images = ...; -QFuture thumbnails = QtConcurrent::mapped(images, std::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation)); +QFuture thumbnails = QtConcurrent::mapped(images, [](const QImage &img) { + return img.scaledToWidth(100, Qt::SmoothTransformation); +}); //! [13] //! [14] -- cgit v1.2.3