Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108115

All the Qt concurrent modules are missing support for member function pointer

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.4.0
    • Core: QtConcurrent
    • None
    • All

    Description

      issue: should be able to do something like:

      QtConcurrent::mapped({"some", "sequence"}, PointerToMember, object);
      

       

      Current ugly workaround:

      namespace {
      template <typename Sequence, typename MapFunctionPointer, typename T>
      QFuture<QtPrivate::MapResultType<Sequence,
      std::function<QtPrivate::FunctionPointer<MapFunctionPointer>::Ret
      (QtPrivate::ArgumentType<T>)>>>
      mapped(Sequence &&sequence, MapFunctionPointer map, T* o){
          auto wrapper = [o, map](const ArgumentType<T>& it){
              return std::mem_fn(map)(o, it);
          };
          return QtConcurrent::mapped(std::forward<Sequence &&>(sequence), wrapper);
      }
      }
      

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sonakur Sona Kurazyan
            qtifier Reda BENAMOR
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes