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

  • Home
  • SEARCH
  • 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 6540055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:55:57+00:00 2026-05-25T10:55:57+00:00

the code below produces compiler error C2784: ‘bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)’

  • 0

the code below produces compiler error C2784:

‘bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)’ : could not deduce template argument for ‘const std::_Tree<_Traits> &’ from ‘const std::_Tree_iterator<_Mytree>’

What is wrong with the code? Many thanks in advance; I couldn’t find any posts on that error message that would help me.

#include <map>
#include <set>

void main(){
int i=1;
     std::map<int, int> A;
A[i]=i;
std::set<std::map<int, int>::iterator > setOfIts;
setOfIts.insert(A.begin());
}
  • 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-25T10:55:57+00:00Added an answer on May 25, 2026 at 10:55 am

    What you’re seeing is Visual Studio’s long way of complaining it has no way to compare the iterators you’d like to place in the set, because there’s no appropriate operator <. And since it can’t compare them, it can’t decide whether two iterators have the same value, hence only one of them should be in the set.

    To fix the problem, you can provide a less then operator of your own – see example here. What would be the meaning of iterators equality is up to you to figure out…

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

Sidebar

Related Questions

My code below produces an error, unknown modified |... I'm trying to use it
The code below produces a NumberFormatException in this line: val cache = cf.createCache(Collections.emptyMap()) Do
Given the code below, how would you create/implement SR.h so that it produces the
The code below gives me this mysterious error, and i cannot fathom it. I
The code below gives an error: Property 'Int32 Key' is not defined for type
The code below produces this output fine: This is page one. This is page
The code at the end produces a compile error: NotApplicable.java:7: run() in cannot be
The below code produces output consisting of two green items. Between those items there
Can anyone beat the performance of my integer to std::string code, linked below? There
Code below produces button and icon: Button and input box are not in same

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.