which of the two codes is right and why?
C C::operator++() { x++; y++; return *this; } C & C::operator++() { x++; y++; return *this; }
thanks
The second is idiomatic: the-less option operator++is a pre-fix increment operator that should return a reference to self.
operator++
Both are "correct", but the second is idiomatic because he expected the prefix to operator ++return an lvalue.
operator ++
Source: https://habr.com/ru/post/1526400/More articles:Java Regex To Uppercase - javaУпорядочить элементы в списке, чтобы аналогичные элементы были наиболее удалены друг от друга - pythonHow to use mblen ()? - cCSS3 - How do I make one element (preferably a div element) move, moving over another element? - htmlWhy are several click events triggered when using ngTouch? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1526401/vim-remap-control-commands-to-space-commands&usg=ALkJrhgAtzJ3zCZ_M94HBTtEQXIO8Tj2FAneed a simple way to create a comparator class used for sorting - java.Net Управление памятью приложений - memory-managementКак разбить не-английский текст на составляющие символы в javascript? - javascriptWhat is uuid ossp in postgres - uuidAll Articles