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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:59:04+00:00 2026-05-31T08:59:04+00:00

On page 172, Stroustrup is doing something like so: namespace Parser { //interface for

  • 0

On page 172, Stroustrup is doing something like so:

  namespace Parser {   //interface for users
    double expr(bool);
  }

  namespace Parser { //interface for implementers
    double prim(bool);
    double term(bool);
    double expr(bool);

    using Lexer::get_token;
    <SNIP>
  }

Q1. does this imply that the first namespace is being inserted into (as an example) user.h and included from main.cpp – the driver; the second namespace into implementer.h and included from parse.cpp? Is this why he says:

“compiler doesn’t have sufficient information to check the consistency
of the two definitions of the namespace”

  • because both implementer.h and user.h can’t be included into “Parser implementation”(parse.cpp)?

172.png
173.png

On page 174, he has:

  namespace Parser {   //interface for implementers
    // ...
    double expr(bool);
   // ...
  }

  namespace Parser_interface { //interface for users
    using Parser::expr;
  }

Is upper namespace going into implementer.h and lower one into user.h

In his “dependency graph” is he restating the obvious: that when Make is run, any change to “Parser”(parser.cpp/implementer.h) will result in driver/main.cpp being rebuilt – unnecessarily?

174.png

  • 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-31T08:59:05+00:00Added an answer on May 31, 2026 at 8:59 am

    http://groups.google.com/group/alt.comp.lang.learn.c-c++/browse_thread/thread/3be9f35f2969f311/0d418ec6138a7e58#0d418ec6138a7e58

    (the part about compiler consistency is wrong and the above thread states why:
    Yes, the implementation can and should do that, but the checking of
    consistency only works to a certain extent. If user.h uses things that are
    not declared there, you will get a diagnostic. If you have “double
    expr(bool);” declared in one place and “float expr(bool);” in another, the
    compiler should also give you a diagnostic. However, if you change the
    second one to “float expr(int);”, then this is just an overload which is
    perfectly legal C++. – Ulrich Eckhardt)

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

Sidebar

Related Questions

The page I'm trying to load is something like this (although, the number of
I have a page which allows users to upload photos - fairly standard php
Page A has a meta refresh to redirect to another page, C , after
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div
Page in question: http://phwsinc.com/our-work/one-rincon-hill.asp In IE6-8, when you click the left-most thumbnail in the
page contents: aa<b>1;2'3</b>hh<b>aaa</b>.. .<b>bbb</b> blabla.. i want to get result: 1;2'3aaabbb match tag is
On page 4, it says: Objective-C decides dynamically--at run-time--what code will handle a message
This page from Adobe says to add a wmode parameter and set its value
The page Protecting Your Cookies: HttpOnly explains why making HttpOnly cookies is a good
This page mentions how to trunc a timestamp to minutes/hours/etc. in Oracle. How would

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.