Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6159147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:04:59+00:00 2026-05-23T21:04:59+00:00

It seems that QtConcurrent works fine with QT containers ( QList and QVector ),

  • 0

It seems that QtConcurrent works fine with QT containers (QList and QVector), but fails with the STL containers, as opposed to what is claimed in the documentation

Here are the dummy functions I want to use on my containers :

void addOne(int & i)
{
    ++i;
}

int addOneC(const int & i)
{
    return i+1;
}

Examples of what works :

int main( int argc, char** argv )
{
    // Qt containers
    QList<int> l;
    l << 1 << 2 << 4 << 3;
    QList<int> l1 = QtConcurrent::blockingMapped(l, addOneC);
    QtConcurrent::blockingMap(l1, addOne);

    // Standard containers
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(4);
    v.push_back(3);
    QtConcurrent::blockingMap(v, addOne);
}

What does not work :

int main( int argc, char** argv )
{
    // Standard containers
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(4);
    v.push_back(3);
    vector<int> v1 = QtConcurrent::blockingMapped(v, addOneC);
}

It cause a compilation error with atrociously long and obfuscate template errors.

If anyone knew why, it would really help! Thanks!


The error log :

1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(442) : error C2825: ‘_Alloc’: must be a class or namespace when followed by ‘::’
1> .\main.cpp(187) : see reference to class template instantiation ‘std::_Container_base_aux_alloc_real<_Alloc>’ being compiled
1> with
1> [
1> _Alloc=int
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(442) : error C2903: ‘rebind’ : symbol is neither a class template nor a function template
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(442) : error C2039: ‘rebind’ : is not a member of ‘global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(442) : error C2143: syntax error : missing ';' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(442) : error C2039: 'other' : is not a member of '
global namespace”
1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(442) : error C2238: unexpected token(s) preceding ‘;’
1>.\main.cpp(187) : error C2248: ‘std::_Container_base_aux_alloc_real<_Alloc>::~_Container_base_aux_alloc_real’ : cannot access protected member declared in class ‘std::_Container_base_aux_alloc_real<_Alloc>’
1> with
1> [
1> _Alloc=int
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(435) : see declaration of ‘std::_Container_base_aux_alloc_real<_Alloc>::~_Container_base_aux_alloc_real’
1> with
1> [
1> _Alloc=int
1> ]
1>.\main.cpp(187) : error C2440: ‘initializing’ : cannot convert from ‘std::_Container_base_aux_alloc_real<_Alloc>’ to ‘std::vector<_Ty>’
1> with
1> [
1> _Alloc=int
1> ]
1> and
1> [
1> _Ty=int
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:05:00+00:00Added an answer on May 23, 2026 at 9:05 pm

    I think you should explicitly give the type of the container to the blockingMapped.

    int main( int argc, char** argv )
    {
        std::vector<int> v;
        v.push_back(1);
        v.push_back(2);
        v.push_back(4);
        v.push_back(3);
    
        std::vector<int> v1 = QtConcurrent::blockingMapped<std::vector<int> >(v, addOneC);
    }
    

    Compile and give me the expected result in the simple example you gave.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems that mcrypt_decrypt can't proper decrypt my string (all works fine in var_dump except
Seems that there is only doubly linked list (but no singly linked list) in
Seems that it may not be possible, but hey I might as well ask,
It seems that this should be simple, but I'm having trouble figuring out how
Seems that lot of people already know that issue but I can not find
It seems that sending stl complex data via the skeleton/content mechanism does not work.
Seems that requirements on safety do not seem to like systems that use AI
Seems that even after unchecking the option in the PyDev/Debug preferenecs pane to launch
It seems that a List object cannot be stored in a List variable in
It seems that it is impossible to capture the keyboard event normally used for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.