2 ms·
static variables, methods, functions, and linkage IIRC. But the fifth, and most important of all, is race conditions...
by AdieuToLogic 11y ago
static variables, methods, functions, and linkage IIRC.
But the fifth, and most important of all, is race conditions...
- marvy 11y agoI think you're double-counting something: 1) static variables outlive function scope 2) static methods don't get a 'this'. 3&4) static functions have no linkage?? I like your fifth though :)
- AdieuToLogic 11y agoD'oh! I was thinking that it was a trick question and there was a corollary to <code>extern "C" { ... }</code>. I out thunk myself on that one. Which leaves translation unit variables, class variables (which I had erroneously included in translation unit variables initially), class methods, and translation unit functions.
- sago 11y agoIf I remember rightly (many many years ago) that's what he was looking for, and to me I struggled because I thought of the two orthogonal effects it conflates: that of lifetime and visibility. From that I had to re-engineer his four, but put (iirc) translation unit variables and functions together. Anyway, the question was 'tell me what I'm thinking', not 'do you understand C++'. But I think between the two of you you might pass :) I remember he was insufferably smug about how good a question it was for sorting out real C++ programmers from wannabes like me :D I knew then I couldn't work with him.