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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:19:51+00:00 2026-06-14T15:19:51+00:00

I have written a quite extensive framework that drives characters in a physical simulation.

  • 0

I have written a quite extensive framework that drives characters in a physical simulation. Even though everybody warned me not to do it, I used a global public data structure for storage of information and called it State. It’s not in a namespace either. I make it globally accessible by declaring extern State state;. The reason why I did this is because this structure is needed everywhere in the application and I find it extremely convenient to just include my State.h and then write to state.var anywhere and read state.var anywhere. The framework is changing rapidly, too, and I also find comfort in not having to care about passing data around, synchronizing etc. when new components are introduced.

Anyhow, now the s*** hit the fan. I want to use one of Qt’s GUI classes and it already has it’s own member called state of type State. Their state is at least in a namespace, but it doesn’t seem to matter, since inside the class I’m already using that namespace.

What can I do now?

  • 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-14T15:19:52+00:00Added an answer on June 14, 2026 at 3:19 pm

    I probably do not understand the problem, but what’s stopping you from doing

    ::state.var
    

    ?

    Plain :: means global namespace, and while using global symbols has the well known issues, and global variables also have their own set of issues (generally in C++ code, singletons are used instead), there’s nothing magically evil about using a global variable in the global namespace. ::errno is an example of such a variable linked to practically every C and C++ application on Unix-like platforms.

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

Sidebar

Related Questions

I have the following code that was written without Tests but is actually quite
I am quite new to JavaScript, I have written some code that just reloads
I have written a script image.php that is quite long, but I've just copied
I have written the following script below - I am not quite happy with
I have written quite a few Ruby programs, but if I need to show
it's late, I'm tired, and probably being quite dense.... I have written an application
I have a written a very simple UDP Server using Netty - it quite
I have written an apex class that will create a PDF quote and attach
I have written a function that sorts a big scale of data. To test
I have a relatively extensive sqlite database that I'd like to import into my

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.