Skip to main content
Stack Overflow
  1. About
  2. For Teams

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
16 votes
3 answers
965 views

I have a function template f, defining in its body a local class A with another nested class B. Both classes are not templates. Must I name the inner class as typename A::B or shorter variant A::B is ...
Advice
2 votes
4 replies
253 views

Any C++ class can be first forward declared, and defined only later in the program. Are function-local classes an exception from this rule? Please consider a simplified program: auto f() { struct ...
7 votes
1 answer
207 views

In C++, forward declarations introduce an incomplete type. Incomplete types can be used to declare pointers, but they cannot be used to initialize values or access members because the complete ...
0 votes
1 answer
80 views

Can nested classes or anonymous classes extend a class or implement an interface in Java? If so, are there any limitations or things I should be aware of? I'm not very familiar with nested classes, ...
1 vote
1 answer
73 views

I have a nested class that uses static vars to have class wide parameters and accumulators. If I do it as a standalone class it works. If I do a nested class and inherit the standalone class, it works....
0 votes
2 answers
59 views

Say, I have an abstract superclass and an abstract test class for testing subclasses. abstract class Superclass { } @RequiredArgsConstructor abstract class SuperclassTest<T extends Superclass> {...
0 votes
0 answers
74 views

The following scala3 code compiles: trait Product trait Provider[+P <: Product] { def provide: P } class Outer extends Provider[Outer#Inner] { override def provide:...
2 votes
1 answer
46 views

I find an "Argument type mismatch" error in multiply function and don't know how to fix it. The code is: abstract class Semigroup<T1> { abstract val one: SemigroupElement<T1> ...
1 vote
1 answer
44 views

In the code you can see nested interfaces. The error in Intellij IDEA is: Kotlin: None of the following candidates is applicable: :25 The error is in the line: return Integer(this.value + other.value)...
1 vote
0 answers
70 views

suppose I have a template class template<typename T> struct Foo { struct Bar; }; specializing Foo<int>::Bar template<> struct Foo<int>::Bar { struct Private; // I ...
0 votes
2 answers
50 views

NOTE: I'm not talking about the way of accessing the enclosing class FROM the inner class, that is not the problem at all. What I'm talking about is the following: class TopLevel { class ...
mipo256's user avatar
  • 3,366
-1 votes
2 answers
100 views

Java shouldn't allow static methods within an inner class and yet this code compiles and runs. How is this possible? class Test{ static int j=20; public void m1() { class Inner{ ...
1 vote
0 answers
57 views

I am looking to serialize a nested class on condition that value of an attribute is different than some custom value. I was looking at: https://devblogs.microsoft.com/dotnet/system-text-json-in-dotnet-...
0 votes
2 answers
182 views

I am very curious about this question. The Java Language Specification has told me part of the reason: In a class instance creation expression for a non-private inner member class, §15.9.2 specifies ...
0 votes
1 answer
133 views

I have a class (MainApplication) that envelopes all my other classes, and an if statement that is outside of the outer class. I'm struggling to figure out how to access 'Start' from that if statement, ...

15 30 50 per page
1
2 3 4 5
...
196

AltStyle によって変換されたページ (->オリジナル) /