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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:21:13+00:00 2026-05-29T05:21:13+00:00

We usually use namespaces to avoid name clashes in C++. But what if there

  • 0

We usually use namespaces to avoid name clashes in C++. But what if there are two different libraries which have a class, that has the same namespace name and class name? Is there a work around?

(PS: I am pretty sure, that its a rare scenario, I never faced it, just happened to cross my mind)

  • 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-29T05:21:14+00:00Added an answer on May 29, 2026 at 5:21 am

    It might happen, but its not very likely to do you much damage. Not only do the namespace names have to be exactly the same, you have to actually use both libraries. Chances are, if they’ve named their namespaces in some reasonable way, their names will indicate their purpose — even if there are two libraries that use GenericXMLParser as their namespace, and probably have some class names in common, do you really expect to be using them both on one project?

    This does make certain namespace names a bad idea, such as boost or Ogre. Anyone using those (except the original users) should expect their library to be unusable in many cases. A less common name, like Pie, is probably going to be fine for by far most people in by far most cases. If both libraries using Pie become widely used, one might have to change; in that case, the namespace renaming trick can be used to keep backwards compatibility with old code.

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

Sidebar

Related Questions

I usually use IIS in conjunction with the OutSystems development platform, which does code-generation
I usually use Visual Studio Team System 2008 Source Control Explorer with TFS, but
I'll preface this by saying that I usually work in C#/.Net. Normally, I use
I usually create ASP.NET websites and have a few classes I use, mainly a
I usually use MySQL Query Browser for my queries, but I always run into
I usually use the UUID class to generate unique IDs. This works fine if
I usually use StructureMap in v 2.5. I think that v2.0 ist compatible to
I usually use Fiddler to monitor HTTP request and response, but if it is
I usually use the Ruby on Rails framework but for this project I need
i usually use ShareKit to add share featuring into my apps, but since with

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.