Top "Member-functions" questions

A function declared and/or defined within a class.

C++ volatile member functions

class MyClass { int x, y; void foo() volatile { // do stuff with x // do stuff with y } }; Do I need to …

c++ volatile member-functions
How to list the functions/methods of a javascript object? (Is it even possible?)

This question is intentionally phrased like this question. I don't even know if this is possible, I remember vaguely hearing …

javascript methods scope member-functions
How do I call a class method from another file in Python?

I'm learning Python and have two files in the same directory. printer.py class Printer(object): def __init__(self): self.…

python member-functions
Free function versus member function

What is the advantage of having a free function (in anonymous namespace and accessible only in a single source file) …

c++ dependencies member-functions pimpl-idiom non-member-functions
Why member functions can't be used as template arguments?

Why member functions cannot be used as template arguments? For example, I want to do like: struct Foo { void Bar() { // …

c++ templates member-functions
const type qualifier soon after the function name

In C++ sometimes I see declarations like below: return_type function_name( datatype parameter1, datatype parameter2 ) const { /*................*/} What does this …

c++ constants member-functions
Effective C++ Item 23 Prefer non-member non-friend functions to member functions

While puzzling with some facts on class design, specifically whether the functions should be members or not, I looked into …

c++ encapsulation member-functions non-member-functions effective-c++
Is qualified name in the member function declaration allowed?

This code is accepted by MSVC9.0. My question is whether it is legal according to the standard (the old and/…

c++ c++11 grammar qualified-name member-functions
Why can a static member function only be declared static inside the class definition and not also in its own definition?

While implementing a class for creating/updating boxes on the screen, I wanted to add a static member function that …

c++ static member-functions
Why can some operators only be overloaded as member functions, other as friend functions and the rest of them as both?

Why can some operators only be overloaded as member functions, other as non-member "free" functions and the rest of them …

c++ class operator-overloading member-functions