Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualbedtime

Posted 27 November 2012 - 09:15 PM

Why do you have braces in the line:
Map.insert({std::make_pair<int, int>(1, 2), gameObj1}); ?

I'm not sure how to get the code to work without them. I get a compile time error.

I just tried changing the code to:

[source lang="cpp"]getMap()->insert(std::make_pair(std::make_pair(1,2), gameObj1));[/source]
its okay just inserting the once, but if I repeat the code above or try to access getMap() again it seg faults.

#1bedtime

Posted 27 November 2012 - 08:59 PM

Why do you have braces in the line:
Map.insert({std::make_pair<int, int>(1, 2), gameObj1}); ?

I'm not sure how to get the code to work without them. I get a compile time error.

PARTNERS