Skip to main content
3 votes
2 answers
106 views

Given a wrapper type template <typename T> struct Ptr { Ptr(T*); }; a class hierarchy struct Base {}; struct Derived : Base {}; and a set of function overloads void f(Ptr<Base>); ...
Michael Deom's user avatar
1 vote
1 answer
98 views

If I have a class constructor with two overloads taking in different inputs, is there a way to tell them apart? For example, class example { double ExampleDouble; char ExampleChar; public: ...
yes's user avatar
  • 19
0 votes
0 answers
63 views

I am designing a container (yeah, do not reinvent the wheel, I know). Let's call it Container<T>. I have a constructor to allow the initial number of elements: explicit Container(std::size_t ...
LeDYoM's user avatar
  • 999
1 vote
0 answers
51 views

I'm on a team with two other devs. For the past few months I've been working on a project in C# 12 independently, and only recently have the other devs pulled my code and run it. For one of them it ...
mdirks's user avatar
  • 73
1 vote
0 answers
183 views

I have a Managed Record named TEmail with a nested private class called TEmailForm that inherits from TForm. The idea is my email Record can create a modal form as needed for the user to type an email....
dallin's user avatar
  • 9,514
0 votes
2 answers
56 views

public class Sample { int id; String name; int age; Sample(int i, String n){ id = i; name = n; } Sample(int i, String n, int a){ id = i; ...
koolest's user avatar
1 vote
1 answer
99 views

I have a class Vec<C> that works as below, and I need to know a way to write the constructor and/or deduction guide such that a braced-enclosed initializer list deduces C as std::array<T,N>...
Astor's user avatar
  • 394
2 votes
3 answers
164 views

I am trying to implement a list container in C++, and I have problem with compiler selecting the wrong constructor overload. The constructors are as follows: list(size_type count, const T& value); ...
Emre Erdog's user avatar
3 votes
1 answer
169 views

Consider the following two classes: struct Base { Base() = default; Base(auto&&); }; struct Derived : Base { using Base::Base; }; If I try the following test with Type = Base and ...
Dr. Gut's user avatar
  • 3,335
0 votes
1 answer
55 views

I am attempting to create an overloaded contructor that will take in integer and add them with the byteAdd function. However; whenever I compile the output is always the default constructor rather ...
Steven Osi's user avatar
1 vote
2 answers
169 views

I am writing a small library for working with polynomials. The main class is called poly and it contains 4 overloaded constructors. An object of class poly is a representation of one polynomial. Full ...
Bartłomiej Konecki's user avatar
3 votes
2 answers
963 views

I am porting a project from Java to Python and there is a class with multiple constructors. I'm trying to port that same idea to python, in a pythonic way. I've recently been informed of the typing....
CraneStyle's user avatar
0 votes
0 answers
31 views

Hi I'm trying to learn java This a simple program that stores a patient's blood details, well in any case how can i keep the program accurate by means of returning an error message if the input was ...
Annika's user avatar
  • 1
1 vote
2 answers
760 views

I am working on a class PlaybackControl, I use it to create two HTMLElements: PlaybackControlButton: HTMLButtonElement PlaybackControlMenu: HTMLDivElement Now, to initialise the class object, I need ...
D V's user avatar
  • 416
1 vote
1 answer
1k views

If in C++ a class had an overloaded constructor: class MyClass { std::string name; public: MyClass(){}; MyClass(std::string name_){ name = name_;} }; how do I expose this to python? Can I ...
sodiumnitrate's user avatar

15 30 50 per page
1
2 3 4 5
16