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 1109497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:14:41+00:00 2026-05-17T02:14:41+00:00

those are the maps: multimap<SortKey,T> firstMap; multimap<SearchKey,pair<SortKey,T>*> secondMap; template <class T,class SortKey, class SearchKey>

  • 0

those are the maps:

multimap<SortKey,T> firstMap;
multimap<SearchKey,pair<SortKey,T>*> secondMap;


template <class T,class SortKey, class SearchKey> bool GarageDataBase<T,SortKey,SearchKey>::Add(T data,SortKey key1, SearchKey key2) 
{
 multimap<SortKey,T>::iterator it;
 it=(firstMap.insert(pair<SortKey,T>(key1,data)));
 pair<SortKey,T> *mizi=&*it;

 secondMap.insert(pair<SearchKey,pair<SortKey,T>*>(key2,mizi));
 return true;
}

I am trying to insert a pair into the firstMap and get a pointer to this pair and insert it into the “second” field in the secondMap

so that i could go into my firstMap from the secondmap.

pair<SortKey,T> *mizi=&*it;

this doesn’t compile saying :

error C2440: 'initializing' : cannot convert from 'std::pair<_Ty1,_Ty2> *' to 'std::pair<_Ty1,_Ty2> *'

any idea whats going on or maybe a better way to make it work?

  • 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-17T02:14:42+00:00Added an answer on May 17, 2026 at 2:14 am

    pair<SortKey,T> is not the same as multimap<SortKey,T>::value_type. The latter is pair<const SortKey,T> since the key is not supposed to change. And since pair<SortKey,T> and pair<const SortKey,T> are not reference-related but two distinct types, the compiler doesn’t accept the code. If you account for the const key it should work.

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

Sidebar

Related Questions

Those icons you can find in the sdk/platforms/data/res/drawable-hdpi... such as ic_delete. How would you
I'm working on a google maps project, where you add addresses to a database,
The GDirections class of Google maps API helped me in displaying the route between
I have those maps in my repository. public IQueryable<AwType> GetAwTypes() { return from awt
Using http://maps.google.com/maps/geo?q= .... return latitude and longitude like those : 48.8616441,2.3448885 in a return
Suppose 2 Maps import qualified Data.Map as M sparse1, sparse2 :: M.Map Int Float
I want to access some data from Google maps. the only way possible is
maps = (maps.filter(name__icontains=search_terms) | maps.filter(description__icontains=search_terms)) I can't find the meaning of these filter arguments.
those of you who read my previous questions may already know this: I'm currently
Those dark spinning progress dialogs in the Amazon and Engadget apps - are those

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.