Skip to main content
1 vote
0 answers
110 views

Here's a piece of Qt code: int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QGuiApplication app2(argc, argv); The first constructor call returns, the second does not. I ...
Ivan's user avatar
  • 377
-5 votes
3 answers
205 views

Consider passing a shared pointer of const std::shared_ptr<Object> to the ctor of following class. struct MyClass { explicit MyCLass(const std::shared_ptr<const Object> & input) : ...
Alex Suo's user avatar
  • 3,167
2 votes
2 answers
111 views

I have the following code that defines an abstract class and its final subclasse. The two classes are both subclasses of the equinox.Module class, which registers class attributes as the leaves of a ...
Ben's user avatar
  • 539
3 votes
6 answers
202 views

I have some tricky code that I need to initialize many objects that refer to each other. I want to allocate and construct them all at once, so I put them all in a struct. It looks like this: // User ...
Guillaume Racicot's user avatar
1 vote
1 answer
93 views

So I’m kinda stuck wrapping my head around this whole parent-child dependency thing. My assumption was, once you declare all the dependencies in the parent (BaseController), the child (like ...
Joey's user avatar
  • 93
0 votes
0 answers
34 views

While I was learning the language, I became interested in primitive types and their object wrappers. While I was in my code editor discovering this language feature, I discovered that any of these ...
d10's user avatar
  • 1
-2 votes
4 answers
142 views

I'm working on a .NET application where every command/query handler needs access to three shared services: IValidator, ISecurity and ILogger. Rather than manually injecting these into each handler ...
Mahmudul Hasan's user avatar
4 votes
1 answer
73 views

I have the following: class A: def __init__(self, x): self.x = x A(5) # Works fine x = A.__new__ # Save the function A.__new__ = lambda y: y # Temporarily override it A.__new__ = x # ...
user9185231's user avatar
1 vote
2 answers
115 views

I want to create a variable of type Foo. The class Foo consists of a variable called Bar bar_ which is filled directly in the constructor initialization. The thing is, class Bar has a reference to the ...
peter's user avatar
  • 59
6 votes
1 answer
246 views

I'm getting a compiler error about a type conversion that should be legal, to my eyes. Let's say I have a home-grown string class, convertible from and to char*: class custom_string { public: ...
Peter Yurkosky's user avatar
1 vote
1 answer
88 views

I'm trying to learn constructors and statics and I'm not sure what I'm doing wrong here controller <?php namespace App\Http\Controllers\Api; use App\Models\SampleModel; class SampleController { ...
rhemmuuu's user avatar
  • 1,209
2 votes
1 answer
48 views

My error is SiteChecker is not a function I was following this guy steps https://www.thepolyglotdeveloper.com/2020/06/scan-broken-links-website-javascript/ to set up package and execute , but on my ...
Nina Mishchenko's user avatar
0 votes
1 answer
122 views

I'm trying to explicitly instantiate a forwarding constructor using C++20 with GCC 13.3 compiler in order not to put its definition in the header file. Here is a minimal example: Foo.h #pragma once ...
bobeff's user avatar
  • 3,771
2 votes
1 answer
135 views

I have this record: record Foo { string _bar = "initialized"; public string Bar => _bar; } I'm running the following code: var foo = new Foo(); Console.WriteLine(foo?.Bar ?? &...
Ivan Petrov's user avatar
  • 7,349
1 vote
1 answer
62 views

In the example, there is a "match redundant" Error, indicating that SOME s is matching on every string and not the provided s: fun matchs (s : string) : (string option -> bool) = fn x =&...
qwr's user avatar
  • 11.5k

15 30 50 per page
1
2 3 4 5
1413