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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:46:24+00:00 2026-06-13T03:46:24+00:00

Possible Duplicate: C++ – Why static member function can’t be created with ‘const’ qualifier

  • 0

Possible Duplicate:
C++ – Why static member function can’t be created with ‘const’ qualifier

Was curious to know the reason why static member functions cant be declared as const or volatile or const volatile ?

#include<iostream>

class Test 
{     
   static void fun() const 
   { // compiler error
       return;
   }
};
  • 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-13T03:46:27+00:00Added an answer on June 13, 2026 at 3:46 am

    Because that’s what the standard says:

    9.4.1 Static member functions [class.static.mfct]

    2) [ Note: A static member function does not have a this pointer (9.3.2). —end note ] A static member
    function shall not be virtual. There shall not be a static and a non-static member function with the
    same name and the same parameter types (13.1). A static member function shall not be declared const,
    volatile, or const volatile
    . (emphasis mine)

    The reason for this is that a const (or volatile or virtual) static method wouldn’t make sense (in the traditional sense, see below). For example, const implies you can’t modify the object’s members, but in the case of statics, there’s no object to talk about.

    You could argue that a const static could apply to other static members, but this option was regarded as pointless.

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

Sidebar

Related Questions

Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: C# driver development? I would like to know if I can do
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: Can’t create handler inside thread that has not called Looper.prepare() inside AsyncTask
Possible Duplicate: Realloc is not resizing array of pointers Can anyone tell me where
Possible Duplicate: Can a Bash script tell what directory it's stored in? Is there
Possible Duplicate: std::string and its automatic memory resizing I am just curious, how are
Possible Duplicate: How to successfully rewrite old mysql-php code with deprecated mysql_* functions? I
Possible Duplicate: Matlab gives wrong answer Can anyone explain to me why the following

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.