Skip to main content

Questions tagged [constructor]

A special type of subroutine called at the creation of an object.

0 votes
0 answers
18 views

I ported C++ implementation of Lempel method for constructing Costas arrays to Mathematica. How to fix my code? Thanks in advance. ...
138 Aspen's user avatar
  • 469
2 votes
0 answers
34 views

I ported C++ implementation of Welch method for constructing Costas arrays to Mathematica. Any feedback would be appreciated. ...
138 Aspen's user avatar
  • 469
2 votes
1 answer
99 views

Need some input on using std::variant for the constructor. The top section explains why I have so man constructors. The review is really about the last bit of code ...
Loki Astari's user avatar
  • 97.7k
3 votes
1 answer
270 views

I proposed several techniques to answer to https://stackoverflow.com/q/78672409/21691539. A classical way to answer would be to use std::index_sequence-based ...
Oersted's user avatar
  • 337
2 votes
1 answer
125 views

recently I implemented a little helper class, which can be primarily utilized on perfect forwarding constructors. Introduction As a slight example, let me pull in two of the ...
DNKpp's user avatar
  • 791
1 vote
2 answers
213 views

I am learning the behavior of C++'s special member function, using a naive String class as example. (The code is modified from this tutorial) Here is the ...
Der Fänger im Roggen's user avatar
6 votes
2 answers
1k views

How can I improve this code or make it tidier? ...
user366312's user avatar
1 vote
1 answer
82 views

Here is a part of my new code replacing the old and deprecated old-school one. Let's get to business right away: I document everything with Documentation comments, which are proving very useful so ...
Vlastimil Burián's user avatar
6 votes
3 answers
267 views

Semester is a simple enum class. ...
Hyeonseo Yang's user avatar
0 votes
1 answer
174 views

While creating a game engine using c++, when defining a component, I was tired of writing down essential but repeated elements such as 'GameObject* parent' every time I define a new component ...
김범무's user avatar
2 votes
2 answers
144 views

I have a class Scholar which is basically a teacher in a university. I have to calculate the yearly salary of a scholar instance where the formula is ...
tmo's user avatar
  • 33
0 votes
1 answer
80 views

I have class CellGroup that contains List of cell lists That class has creation of list inside and transforming it to list of lists. ...
DozezQuest's user avatar
0 votes
2 answers
202 views

I created a class in a separate .h and .cpp file with the idea of having an array of 3 monsters with each monster having different stats( name; health; damage). The problem is that the constructor ...
Nis's user avatar
  • 9
4 votes
1 answer
321 views

Context As many of you may know I have a library that allows C++ objects to be converted into JSON/YAML/BSON automatically with a single declaration (see previous code reviews). I am now (trying) ...
Loki Astari's user avatar
  • 97.7k
10 votes
2 answers
755 views

I understand that creating public properties that control private fields is good practice because of coupling and encapsulation, although lately I have seen it as such a waste of boilerplate code for ...
Josh Hallow's user avatar
  • 1,355

15 30 50 per page
1
2 3 4 5
11