[Interest] QtConcurrent::map with a member function and a list of pointers
Thiago Macieira
thiago.macieira at intel.com
Thu Sep 26 03:42:56 CEST 2013
On quinta-feira, 26 de setembro de 2013 00:34:35, Etienne Sandré-Chardonnal
wrote:
> Dear all,
>
> I have a list of pointers : QList<MyClass*> list;
>
> MyClass has a load() function
>
> Now I would like to call something like QtConcurrent::map(list,
> &Myclass::load), but this does not work, as it would with a list of Myclass
> object instead of pointers.
>
> Is there any way to make this work in one line without a wrapper?
QtConcurrent::map(list, [](MyClass *ptr) { ptr->load(); });
Lambdas are supported in GCC 4.5, Clang 3.1, ICC 12, MSVC 2010. All of those
compilers are a couple of years old, so it should be acceptable for you to use
lambdas.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130925/80e9fd58/attachment.sig>
More information about the Interest
mailing list