Top "Class-members" questions

This tag refers to members of a class in object-oriented language.

How can I initialize C++ object member variables in the constructor?

I've got a class that has a couple of objects as member variables. I don't want the constructors for these …

c++ constructor class-members object-construction
Should I prefer pointers or references in member data?

This is a simplified example to illustrate the question: class A {}; class B { B(A& a) : a(a) {} A&…

c++ reference class-members
C++11 allows in-class initialization of non-static and non-const members. What changed?

Before C++11, we could only perform in-class initialization on static const members of integral or enumeration type. Stroustrup discusses this …

c++ class c++11 initialization class-members
C++ define class member struct and return it in a member function

My goal is a class like: class UserInformation { public: userInfo getInfo(int userId); private: struct userInfo { int repu, quesCount, ansCount; }; …

c++ class function struct class-members
How can I access a classmethod from inside a class in Python

I would like to create a class in Python that manages above all static members. These members should be initiliazed …

python class-members
Initialization Order of Class Data Members

In the following code, when the ctor of X is called will the ctor of A or B be called …

c++ initialization class-members
Array as a Class Member

I'm designing a dynamic buffer for outgoing messages. The data structure takes the form of a queue of nodes that …

arrays vba class-members
How to initialize the reference member variable of a class?

Consider the following code C++: #include<iostream> using namespace std; class Test { int &t; public: Test (int &…

c++ oop class-members
In .NET, can you use reflection to get all non-inherited methods of a class?

Because of this issue here, I'm trying to write a custom JsonConverter that handles cases where you subclass a list …

c# reflection subclass base-class class-members
inheritance of abstract class with static property in C#

Short version: I have an abstract class A. It has a method that needs to know the value of a …

c# inheritance static class-members