diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-10-12 14:24:07 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-10-13 09:49:51 +0200 |
commit | d5c53554e5d71e3518a446b634428bb66fc369fd (patch) | |
tree | 2efbf0d703fa400f6ef20e8bee4e8a7d690a0ac7 /src/concurrent/qtconcurrentfunctionwrappers.h | |
parent | 1918c689d78b0f6a718343e7ebceb387acc32a97 (diff) |
Loosen the requirements on the container passed to QtConcurrent::map*
Using std::begin() and std::end() forces the user to have const begin()
and end() member functions being defined for the passed container. This
is because std::declval<T>() returns rvalue which forces the compiler
to select std::{begin, end}()(const Container &c) overloads and an test
for a presence of const {begin, end}() methods.
Change-Id: I9d96d9f73891ece53224f1741a1334500f7b35ad
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/concurrent/qtconcurrentfunctionwrappers.h')
-rw-r--r-- | src/concurrent/qtconcurrentfunctionwrappers.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h index bb78ea9953..be95416759 100644 --- a/src/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/concurrent/qtconcurrentfunctionwrappers.h @@ -77,7 +77,7 @@ struct Argument template <class Sequence> struct Argument<Sequence, typename std::enable_if<IsIterableValue<Sequence>>::type> { - using Type = std::decay_t<decltype(*std::begin(std::declval<Sequence>()))>; + using Type = std::decay_t<decltype(*std::declval<Sequence>().begin())>; }; template <class Iterator> |