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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:10:27+00:00 2026-06-07T10:10:27+00:00

Do invocations of std constructors need to be qualified with std:: ? class whatever

  • 0

Do invocations of std constructors need to be qualified with std::?

class whatever : public std::runtime_error
{
public:
    explicit whatever(const std::string& what) : runtime_error(what) {}
};                                            // ^ do I need std:: here?

It works on my compiler without the qualification, but I’m not sure whether that behavior is standard.

  • 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-07T10:10:29+00:00Added an answer on June 7, 2026 at 10:10 am

    No you don’t. The names in the initializer list are looked up in the scope of the whatever class. This class scope includes names declared in base classes and the name of the base class (runtime_error) is inserted into the scope of std::runtime_error (this is standard behaviour for all classes).

    Note that this doesn’t work if the name that you use is a typedef for the actual class name. You can easily be tempted with, e.g., std::istream and friends. See here.

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

Sidebar

Related Questions

Here is my template function template<typename T> std::stringstream logging_expansion ( T const * value
Let's say I have a function, taking an rvalue reference: void whatever (std::unique_ptr<int>&&) {
Here are four simple invocations of assert: >>> assert 1==2 Traceback (most recent call
I need to find all invocations of some logging macros in the code. The
I want to trace all invocations of methods from a Foo class. Another class
I see explicit gc invocations in our gc-log (see below). I am able to
I'm extremely frustrated with the Eclipse formatting rules for a series of qualified invocations
interface: class rmKeyControl { static map<char, function<char(char)>> sm_function_list; public: static bool addKeyAction(char, function<char(char)>); };
I'm getting an error which I cannot resolve. Undefined symbols for architecture i386: ObjSurface::ObjSurface(std::string
Which one of these two method invocations is considered most pythonic? some_method(that_has, very_many, aurguments=None,

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.