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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:47:18+00:00 2026-05-15T18:47:18+00:00

I have this in a header: double commonFunction( … ) { /*…*/ } namespace

  • 0

I have this in a header:

double commonFunction( ... )
{ /*...*/ }
namespace F2
{
    double impactFactor( ... )
    { /*...*/ }
    double func( ... )
    { /*...*/ }
    double F2( ... )
    { /*...*/ }
}
namespace FL
{
    double impactFactor( ... )
    { /*...*/ }
    double func( ... )
    { /*...*/ }
    double FL( ... )
    { /*...*/ }
}

And I would like to access the F2 and FL functions from the global namespace. I tried adding this to the end of the header (or after an include, doesn’t matter):

using F2::F2;
using FL::FL;

I’m sure this works when the function names differ from the namespace names, but why does this not work and how can I fix it? Thanks

PS: I can’t put the functions outside their namespace, because that would lead to a redefined symbol (F2 and FL, as both namespace and function).

UPDATE: for those cursing me, here’s what I did. Since this is a scientific formula header, and a good short namespace name is hard to find I named the namespaces F2 and FL and the functions themselves f2 and fL.

  • 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-15T18:47:18+00:00Added an answer on May 15, 2026 at 6:47 pm

    Because, using brings every declaration with given name into scope, so if you already have two or more declaration with one name (in this case namespace f1), it will complain.

    And it has nothing to do with the name of the namespace and function being the same.
    Even this will generate the same error:

    namespace foo
    {
        void not_foo(){};
    }
    namespace not_foo
    {
        void foo(){}
    }
    using not_foo::foo;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you don't want to use a tee, before you… May 16, 2026 at 4:46 pm
  • Editorial Team
    Editorial Team added an answer If notes should always be related to units, your best… May 16, 2026 at 4:46 pm
  • Editorial Team
    Editorial Team added an answer This is quite easy. Here is the solution. You have… May 16, 2026 at 4:46 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

if I define my constant varibles in my header like this... extern const double
In my header, I have a prototype declaration like this: void move(int, int); I
I have this Tree View that looks like this: <TreeView Grid.Column=0 Grid.Row=2 MinHeight=100 MinWidth=100
I have some basic C++ design/syntax questions and would appreciate your reply. I have
I have this controller set up for a login: <?php class Login extends Controller
So, the javadoc for URLEncoder's encode and URLDecoder's decode have this note in them:
Hi I am trying to init an object with a double value in the
I am trying to pass a custom response header to notify my javascript the
The main culprit behind this question is of course IE6, (almost) everybody agrees that
In my CPP file I have a call that is: pt.x = mDownPoint.x +

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.