Odebírat
|
|
Obrázek 'ppipp'
(Roumen) R (4.1.2026 15:03)
|
reagovat
|
|
-> koš |
|
|
Obrázek 'ppipp'
(X!) (4.1.2026 14:09)
|
reagovat
|
|
#include
struct W{int v; struct P{W* p; P& operator++(){++p->v; return *this;}}; P operator++(int){++v; return P{this};}};
int main(){W i{0}; ++i++; std::cout |
|
|
Obrázek 'ppipp'
(X!) (4.1.2026 14:06)
|
reagovat
|
|
v c++ muze:
#include
struct Weird {
int v;
struct Proxy {
Weird* p;
Proxy& operator++() { ++p->v; return *this; } // prefix ++ on the proxy increments original
};
Proxy operator++(int) { ++v; return Proxy{this}; } // postfix ++ increments and returns proxy
};
int main() {
Weird i{0};
++i++; // parses as ++(i++)
std::cout |
|
|
Obrázek 'ppipp'
(quido.speedy) RP (4.1.2026 13:55)
|
reagovat
|
|
V zadnem, i kdybys to pustil pres lexikalni parser, tak te po pravu vyprca syntakticky analyzator… |
|
|
Obrázek 'ppipp'
(Fiiox) (4.1.2026 13:20)
|
reagovat
|
|
V jakem jazyce to funguje? |
|
|
Obrázek 'ppipp'
(tramtada) (4.1.2026 12:41)
|
reagovat
|
|
I use "Chatbot, update this code for me so that the variable i gets increased by 2 so that I can report to management to be 1000% more productive by writing this shitty prompts instead of learning how to actually code." |
|
|
Obrázek 'ppipp'
(cans) RP (4.1.2026 12:36)
|
reagovat
|
ale lepší než politické vtipy |
|
|
Obrázek 'ppipp'
(qak) (4.1.2026 12:24)
|
reagovat
|
|
error C2105: '++' needs l-value |
|
|
Obrázek 'ppipp'
(bIm v perestrojeni 4) (4.1.2026 12:21)
|
reagovat
|
|
Tim se nechlub, ze za tebe musi kastany z ohne tahat kompilator, aby ta tva sracka nebezela sto let. |
|
|
Obrázek 'ppipp'
(tomaasss) RP (4.1.2026 12:10)
|
reagovat
|
|
Nope. I use i+=2 |
|