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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:08:19+00:00 2026-06-01T04:08:19+00:00

What are the differences in compilability or generated code (if any) between the following

  • 0

What are the differences in compilability or generated code (if any) between the following two source files:

Exhibit A:

namespace std {};
using namespace std;
#include <vector>
#include <string>

<any code here>

Exhibit B:

#include <vector>
#include <string>
using namespace std;

<any code here>

Assuming the two <any code here> placeholders are replaced with any identical user code.

Put another way: Is there any user visible difference if “using namespace std;” is put before the standard #includes (assuming namespace std has been introduced as above)?

  • 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-01T04:08:21+00:00Added an answer on June 1, 2026 at 4:08 am

    As unlikely as it may be, the following code could possibly be in your implementation’s vector header:

    namespace __AA
    {
        class vector {};
    }
    
    namespace std
    {
        // actual std::vector implementation here
    }
    
    namespace __BB
    {
        using namespace __AA;
        vector x;
    }
    

    Now with Exhibit A, you’ve got an ambiguity.

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

Sidebar

Related Questions

are there any differences in the references that are produced in code generated for
What are the main differences between using Storyboards and xib files. Specifically, what are
What are the differences between these two prefixes in terms of HttpListener or any
Are there any practical differences between these two ways of getting an exception for
Are there differences between these two? replace(/[^a-z0-9]/gi, ''); replace(/[^a-zA-Z0-9]/g, ''); Also, are there any
What are the main differences (if any) between the box models of IE8 and
What are the differences between these two, and which one should I use? string
Are there any major differences in performance between http and https? I seem to
Can I understand the differences between == and object.equal(Object obj) in the following way?
Are there any important differences between declaring <script type=text/javascript> </script> and <script language=javascript> </script>

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.