VOOZH about

URL: https://www.geeksforgeeks.org/cpp/some-interesting-facts-about-static-member-functions-in-c/

⇱ Some interesting facts about static member functions in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Some interesting facts about static member functions in C++

Last Updated : 23 Jul, 2025

1) static member functions do not have this pointer
For example following program fails in compilation with error "`this' is unavailable for static member functions "

2) A static member function cannot be virtual (See this G-Fact)
3) Member function declarations with the same name and the name parameter-type-list cannot be overloaded if any of them is a static member function declaration. 
For example, following program fails in compilation with error "'void Test::fun()' and `static void Test::fun()' cannot be overloaded "

4) A static member function can not be declared const, volatile, or const volatile
For example, following program fails in compilation with error "static member function `static void Test::fun()' cannot have `const' method qualifier " 

Comment
Article Tags: