#constructors — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #constructors, aggregated by home.social.
-
CW: Ще одна підстава C++
class Point { int x, y; public: Point(int a) : y(a), x(y) {} };Спочатку здається що все добре у цьому коді, але насправді не так, тому що спочатку
xпроініціалізується значеннямy, а вже потімyзначенням аргументуa. Вийде щоxбуде мати випадкове значення. У цьому прикладі все може бути замітно зразу оскільки це тільки маленький приклад, але в реальності не все так просто. Добре що компілятори вміють про це попереджувати, якщо вказати прапорець-Wall.<stdin>: У конструкторі «Point::Point(int)»: <stdin>:2:9: попередження: «Point::y» буде ініціалізовано після [-Wreorder] <stdin>:2:6: попередження: «int Point::x» [-Wreorder] <stdin>:4:2: попередження: коли він ініціалізується тут [-Wreorder] <stdin>:4:25: попередження: член «Point::y» використовується без ініціалізації [-Wuninitialized]#cpp #cxx #class #stuct #constructors #initializelist #ООП #ініціалізація #конструктори
-
Hey #fediverse ! Looking for #interesting #makers #builders #engineers #artisans #inventors #constructors to follow on #pixelfed
-
Hey #fediverse ! Looking for #interesting #makers #builders #engineers #artisans #inventors #constructors to follow on #pixelfed
-
#LeeCronin and #LexFridman - The Greatest #Invention In The History Of The #Universe
https://www.youtube.com/watch?v=6T_x3Teeq40&ab_channel=LexClips
#CellularAutomata #Life #Evolution #Computation #DataStorage #Replication #StateMachine #TuringMachine #VonNeuman #Replicator #Replicators #Constructor #Constructors #PhaseTransition #PhaseTransitions #Mutation
-
#LeeCronin and #LexFridman - The Greatest #Invention In The History Of The #Universe
https://www.youtube.com/watch?v=6T_x3Teeq40&ab_channel=LexClips
#CellularAutomata #Life #Evolution #Computation #DataStorage #Replication #StateMachine #TuringMachine #VonNeuman #Replicator #Replicators #Constructor #Constructors #PhaseTransition #PhaseTransitions #Mutation
-
@nebu how would you distinguish #constructors in #java if the fields had the same type? Anyway, the point was you can create your own constructor that copies all records but a ‘specified’ few. If you need 2^n permutations, then you mine as well use the full constructor every time.
-
@nebu how would you distinguish #constructors in #java if the fields had the same type? Anyway, the point was you can create your own constructor that copies all records but a ‘specified’ few. If you need 2^n permutations, then you mine as well use the full constructor every time.