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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:33:04+00:00 2026-05-22T01:33:04+00:00

In C++ its possible to do the following for namespace versioning First version: namespace

  • 0

In C++ its possible to do the following for namespace versioning

First version:

namespace A__v1 {
  class X ...
  class Y ...
  class Z ...
}
namespace A = A__v1

Second version (where the X class is changed):

namespace A__v1 {
  class X ...
  class Y ...
  class Z ...
}
namespace A__v2 {
  class X ...
  using A__v1::Y;
  using A__v1::Z;
}
namespace A = A__v2

What i would like to know is, is it worth the effort? Does this really add any advantage to your application/library when changing the internals of a namespace?

  • 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-22T01:33:04+00:00Added an answer on May 22, 2026 at 1:33 am

    I actually like the non-macro way of handling this, it allows one build of the library to serve many versions. This will inevitably increase library size (due to more versions of some classes all being present) but there is one caveat though: the compiler will most likely report the full namespace qualification of the classes, making the user of your library, who doesn’t know about your non-standard versioning scheme very confused.

    On second thought, I also don’t see the use of supplying two versions of the same thing in one library build, except if there are different CPUs/architectures involved, but I don’t think that’s what you’re getting at. Keeping old versions of classes around is not smart, people will never switch to the newer ones if they don’t need to, and if something (half-internal) gets deprecated, you’ll have removed something that was “part of the library” so to speak.

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

Sidebar

Related Questions

I want to know if its possible and how to do the following ,
I'm wondering if its possible to add new class data members at run-time in
#include <iostream> using namespace std; class Base { public: Base(){cout <<Base<<endl;} virtual ~Base(){cout<<~Base<<endl;} virtual
Its possible I am just really really thick. However, looking over the SDK for
In VBP its possible to define user defined actions by creating a custom COM
I noticed its possible to run SQL scripts with Oracle's SQLPlus by providing only
I was wondering if its possible to inject a thread into a remote app
Does anyone know if its possible to create a new property on an existing
Does somebody knows if its possible to build a T-SQL query to obtain the
Very direct question, i need to know if its possible and maybe where to

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.