McLaren’s ‘papaya rules’ may be over as Oscar Piastri and Lando Norris battle for the F1 drivers’ championship

If Formula 1 — like many of the world’s pre-eminent d…
#NewsBeep #News #Headlines #ABCSport #Alpine #AU #Australia #CharlesLeclerc #constructors'championship #drivers'championship #F1 #Ferrari #Formula1 #GeorgeRussell #GrandPrix #JackDoohan #LandoNorris #LewisHamilton #maxverstappen #McLaren #Mercedes #OscarPiastri #papayarules #RedBull #Sport
https://www.newsbeep.com/192725/

As #sainz would say.. #Laanndooo ... It's another win, but #Max will still win the championship. #constructors is different. If #checo doesn't step up, #maclaren will give #RB a run 4 their money.
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 #ООП #ініціалізація #конструктори

Social.Net.Ua

Greatest invention in the history of the universe | Lee Cronin and Lex Fridman

YouTube
@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.