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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:01:11+00:00 2026-06-07T19:01:11+00:00

I am confused by the following behavior: My class Application adds in the constructor

  • 0

I am confused by the following behavior:

My class “Application” adds in the constructor elements of the type “SplashScreen” (derived from my class “Screen ” which is the container type) using ptr_map_insert into a pointer container of the type Screen. Example:

boost::assign::ptr_map_insert<SplashScreen>(screenContainer_)(GameScreens::Splash, curWindow_, curFileSystem_, curInputManager_);

According to the documentation of ptr_map_insert, the last pair of brackets begins with the key and the following arguments are passed to the constructor of the SplashScreen class.

curWindow_ etc. are non-const private members of my class “Application”

I don’t know why, but GCC reports an error because the arguments passed to the constructor are const references and the constructor of SplashScreen needs regular references.

SplashScreen(sf::RenderWindow& curWindow, System::FileSystem& curFileSystem, System::InputManager& curInputManager);

The complete error message is below and partially translated by me because it is/was in german.

/usr/include/boost/preprocessor/iteration/detail/local.hpp: In Elementfunktion »boost::assign::ptr_map_inserter<PtrMap, Obj>& boost::assign::ptr_map_inserter<PtrMap, Obj>::operator()(const T&, const T0&, const T1&, const T2&) [with T = Oxid::GameScreens::gameScreenEnum, T0 = sf::RenderWindow, T1 = Oxid::System::FileSystem, T2 = Oxid::System::InputManager, PtrMap = boost::ptr_map<Oxid::GameScreens::gameScreenEnum, Oxid::Screen>, Obj = Oxid::Game::SplashScreen, boost::assign::ptr_map_inserter<PtrMap, Obj> = boost::assign::ptr_map_inserter<boost::ptr_map<Oxid::GameScreens::gameScreenEnum, Oxid::Screen>, Oxid::Game::SplashScreen>]«:
/blabla/main/application.cpp:42:132:   instanced(?) from here
/usr/include/boost/preprocessor/iteration/detail/local.hpp:43:1: Error: no matching function for calling »Oxid::Game::SplashScreen::SplashScreen(const sf::RenderWindow&, const Oxid::System::FileSystem&, const Oxid::System::InputManager&)«
/usr/include/boost/preprocessor/iteration/detail/local.hpp:43:1: Anmerkung: candidates are :
../include/splashscreen.h:16:17: Anmerkung: Oxid::Game::SplashScreen::SplashScreen(sf::RenderWindow&, Oxid::System::FileSystem&, Oxid::System::InputManager&)
../include/splashscreen.h:16:17: Anmerkung:   no known conversion for argument 1 from »const sf::RenderWindow« to »sf::RenderWindow&«
../include/splashscreen.h:13:15: Anmerkung: Oxid::Game::SplashScreen::SplashScreen(const Oxid::Game::SplashScreen&)
../include/splashscreen.h:13:15: Anmerkung:   candidate requires 1 Argument, 3 denoted 

The boost sourcecode doesn’t indicate that arguments are changed to const or something similar. What did I overlook that this conversion occurs?

Edit: Just viewed the actual boost changelog (I am using 1.48.0) but they don’t contain something about this problem.

Regards

  • 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-06-07T19:01:13+00:00Added an answer on June 7, 2026 at 7:01 pm

    As I look at the source it appears that it does take the parameters by const reference, presumably so that in most cases you don’t have loss-of-const concerns. I believe that in your case you’re going to have to use insert directly on the ptr_map instead of the helper template.

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

Sidebar

Related Questions

I'm confused by the following code: import java.util.ArrayList; import java.util.LinkedList; import java.util.List; public class
I'm confused by the following code: class MyException extends Exception {} class AnotherException extends
I'm confused by the following behavior: Using Freebase-Python, I send a request to the
I am trying to write a parser class derived from the Python argparse ArgumentParser
Some time ago I was confused by the following behavior of some code when
I'm somewhat confused by the following behavior I'm seeing within an Xcode project compiled
I'm confused with the addChild: behavior in Cocos2D, because of the following: I have
I am confused with following string function echo strlen(l\n2); //give 3 in output where
I am little bit confused about following problem & their solutions: i have 2
I am confused how the following works in MySQL. In the queries below, the

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.