member Questions

4

Solved

Is there any way to use the ECMAScript6 class notation to declare either a static class variable or a default value for an instance variable? Without class what I have in mind would be written as ...
Monomolecular asked 3/2, 2015 at 20:56

14

Solved

I'm pretty sure this is possible, because I'm pretty sure I've seen it done. I think it is awesome, but I will gladly accept answers along the lines of "this is a terrible idea because ____". Say ...
Impatience asked 30/1, 2009 at 5:50

5

Given a class definition in C++ class A { public: //methods definition .... private: int i; char *str; .... } Is it possible to calculate the offset of a class member at compile time usi...
Impure asked 1/11, 2012 at 15:59

11

Solved

I have got one class with various member variables. There is a constructor and there are getter-methods, but no setter-methods. In fact, this object should be immutable. public class Example { pr...
Aspirator asked 26/5, 2011 at 10:39

3

Solved

How can I get the delegation class of a member property? By this, I mean is it possible to complete such a function: inline fun <reified T> delegationExample(t: T) { for (prop in T::class....
Strake asked 10/9, 2016 at 1:18

3

Solved

I want to access a member of the MainFragment class from PersonAdapter class but none of them are available. I tried making both the classes and the members public and private also but so far nothi...
Binominal asked 31/7, 2017 at 14:8

7

I just got a new PC (Win 7) with VS 2010 (same version as my old PC). I got a VB.NET solution from source control that contains two projects. One of the projects builds fine. The other project flag...
Megagamete asked 1/5, 2013 at 16:55

3

Solved

In Python, I'm quite aware of the fact that one may add members to classes after their definition. But, is there a way to name a member using the content of a string? For example, I may do this: ...
Reel asked 26/12, 2012 at 19:29

14

Solved

I was looking at the Java code for LinkedList and noticed that it made use of a static nested class, Entry. public class LinkedList<E> ... { ... private static class Entry<E> { ... }...
Homosexual asked 31/10, 2008 at 13:36

3

Solved

I'm trying to add a Splash Screen to my form, but I'm getting the error - 'Application' is not a member of 'My'. I've done some research and came across two possible solutions, but neither of ...
Forby asked 16/12, 2013 at 12:26

3

Solved

I need to assign a custom property to a jQuery object. Here is the object: var object = $("<div id='item'></div>"); I need object to have a custom data member. How can I add this?
Arrant asked 22/4, 2010 at 22:51

8

Solved

I'm querying for the ID of a field by accessing a class function which someone has already put in place. The result is a object returned with protected member variables. I'm struggling to see how I...
Nottingham asked 13/8, 2010 at 9:33

3

Solved

It works just fine, for plain vanilla functions. The code below works just fine. It prints just what is should: int __cdecl(int, char) 2 int,char #include <boost/type_traits.hpp> #includ...
Layer asked 29/1, 2010 at 20:44

8

Solved

Suppose I have a class with private memebers ptr, name, pname, rname, crname and age. What happens if I don't initialize them myself? Here is an example: class Example { private: int *ptr; strin...

5

Solved

im having a problem in visual studio it keeps saying i have defined a member with same parameter types. Im new to C# programming and i dont really know what to do. These are the errors that are occ...
Muirhead asked 5/11, 2012 at 17:22

5

Solved

I have two classes class a { public: a(int i); }; class b { public: b(); //Gives me an error here, because it tries to find constructor a::a() a aInstance; } How can I get it so that aInstan...
Undistinguished asked 18/1, 2010 at 20:24

2

Solved

I have a function like this: void f(std::ofstream& ostrm) { auto a = Myglobal->getData1(); ostrm << a; auto b = Myglobal->getData2(); ostrm << b; auto c = Myglobal-&gt...
Turney asked 17/10, 2019 at 7:38

7

Solved

Is there any Java syntax to access new methods defined within anonymous inner classes from outer class? I know there can be various workarounds, but I wonder if a special syntax exist? For example...
Seizing asked 29/5, 2012 at 13:58

3

Solved

I know it's possible to separate to create a pointer to member function like this struct K { void func() {} }; typedef void FuncType(); typedef FuncType K::* MemFuncType; MemFuncType pF = &K::...
Annulose asked 16/6, 2010 at 4:54

1

Solved

What is the best or conventional method to align members inside a structure? Is adding dummy arrays the best solution? I have a struct of double and a triple of doubles? struct particle{ double ...
Round asked 9/8, 2019 at 5:54

5

Solved

I have the following class in PHP class MyClass { // How to declare MyMember here? It needs to be private public static function MyFunction() { // How to access MyMember here? } } I am tota...
Barrel asked 24/12, 2009 at 9:57

5

Solved

This is a simplified version of some of my code: public struct info { public float a, b; public info? c; public info(float a, float b, info? c = null) { this.a = a; this.b = b; this.c = c;...
Greybeard asked 15/2, 2012 at 15:33

5

Is there a way to determine whether an object has at least one of its members on the heap? I am trying to be able to distinguish objects like std::string or std::vector or std::list (yeah mostly c...
Apocope asked 30/6, 2019 at 10:20

6

Solved

It seems that the following technique for checking the existence of an object member produces an error because the 'bar' parent object hasn't been declared before the check, which means I either ha...
Tommy asked 1/7, 2011 at 12:59

1

Solved

We are currently switching our project to Kotlin, and ran across following question: We need a certain extension function only inside a given class. Thus, we have two possibilities: (1) Declaring ...
Jesicajeske asked 20/2, 2019 at 9:22

© 2022 - 2025 — McMap. All rights reserved.