Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKhatharr

Posted 09 November 2012 - 11:32 PM

If you take Khatharr's statement, and think, "how can namespaces be used to provide single global systems", then there's lots of ways you can answer that question, rather than thinking of ways in which it's a nonsense statement. e.g.

namespace MySystem
{
  extern int someGlobalValueModifyWithCare;
  void SomeGlobalProcedureWithHiddenSideEffects();
  float GetSomeHiddenGlobalState();
}
^^That's basically a singleton, without putting any of the implementation details regarding the singleton into your public interface.


That's basically what I mean. I'm not talking about nested types in a namespace. That would just be an extrapolation of a type in the global space.

I have a header that declares the public interface as a namespace and then the private "members" are statics within the code file that implements the namespace.

#1Khatharr

Posted 09 November 2012 - 11:28 PM

If you take Khatharr's statement, and think, "how can namespaces be used to provide single global systems", then there's lots of ways you can answer that question, rather than thinking of ways in which it's a nonsense statement. e.g.

namespace MySystem
{
  extern int someGlobalValueModifyWithCare;
  void SomeGlobalProcedureWithHiddenSideEffects();
  float GetSomeHiddenGlobalState();
}
^^That's basically a singleton, without putting any of the implementation details regarding the singleton into your public interface.


That's basically what I mean. I'm not talking about nested types in a namespace. That would just be an extrapolation of a type in the global space.

PARTNERS