Click here to Skip to main content
15,851,090 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Not So Satisfying Weekend... Pin
#realJSOP19-Jun-22 0:14
mve#realJSOP19-Jun-22 0:14 
GeneralRe: Not So Satisfying Weekend... Pin
Eddy Vluggen18-Jun-22 12:25
professionalEddy Vluggen18-Jun-22 12:25 
QuestionPointers and brain drain Pin
honey the codewitch18-Jun-22 2:47
mvahoney the codewitch18-Jun-22 2:47 
AnswerRe: Pointers and brain drain Pin
Amarnath S18-Jun-22 2:52
professionalAmarnath S18-Jun-22 2:52 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 2:58
mvahoney the codewitch18-Jun-22 2:58 
GeneralRe: Pointers and brain drain Pin
harold aptroot18-Jun-22 3:38
harold aptroot18-Jun-22 3:38 
AnswerRe: Pointers and brain drain Pin
Richard MacCutchan18-Jun-22 3:41
mveRichard MacCutchan18-Jun-22 3:41 
AnswerRe: Pointers and brain drain Pin
Greg Utas18-Jun-22 3:51
professionalGreg Utas18-Jun-22 3:51 
Some things to consider mentioning are
  • Given Class* p, p += n is p + n * sizeof(Class), not p + n. For a long time, I worked in a language where this wasn't the case, so I've rediscovered it several times.
  • The idiomatic if(p) instead of if(p != nullptr). I still refuse to write the former, probably because I never used C and because nullptr was equivalent to UINTPTR_MAX in the language that I used.
  • Smart pointers, particularly unique_ptr. These are great, but adopting them isn't always transparent. It took me a while to find a bug that was caused by the implementation of unique_ptr::reset, which was equivalent to
    C++
    item = this->ptr_;
    this->ptr_ = nullptr;
    delete item;
    I had code that needed to know the object being deleted, so it got broken when it started using unique_ptr::get instead of looking at a raw pointer. The workaround (ctx_ being the unique_ptr) was
    C++
    auto ctx = ctx_.get();
    delete ctx;
    ctx_.release();
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.

AnswerRe: Pointers and brain drain Pin
David O'Neil18-Jun-22 4:24
professionalDavid O'Neil18-Jun-22 4:24 
GeneralRe: Pointers and brain drain Pin
Mircea Neacsu18-Jun-22 6:04
Mircea Neacsu18-Jun-22 6:04 
AnswerRe: Pointers and brain drain Pin
Gerry Schmitz18-Jun-22 5:32
mveGerry Schmitz18-Jun-22 5:32 
AnswerRe: Pointers and brain drain Pin
jmaida18-Jun-22 5:57
jmaida18-Jun-22 5:57 
AnswerRe: Pointers and brain drain Pin
Greg Utas18-Jun-22 5:57
professionalGreg Utas18-Jun-22 5:57 
QuestionRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 12:30
professionalEddy Vluggen18-Jun-22 12:30 
AnswerRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 12:35
mvahoney the codewitch18-Jun-22 12:35 
GeneralRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 13:06
professionalEddy Vluggen18-Jun-22 13:06 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 13:10
mvahoney the codewitch18-Jun-22 13:10 
GeneralRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 13:33
professionalEddy Vluggen18-Jun-22 13:33 
GeneralRe: Pointers and brain drain Pin
Greg Utas18-Jun-22 13:56
professionalGreg Utas18-Jun-22 13:56 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 18:03
mvahoney the codewitch18-Jun-22 18:03 
GeneralRe: Pointers and brain drain Pin
jmaida18-Jun-22 19:05
jmaida18-Jun-22 19:05 
GeneralRe: Pointers and brain drain Pin
jmaida18-Jun-22 19:12
jmaida18-Jun-22 19:12 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 20:09
mvahoney the codewitch18-Jun-22 20:09 
AnswerRe: Pointers and brain drain Pin
jmaida18-Jun-22 12:38
jmaida18-Jun-22 12:38 
QuestionRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 13:28
professionalEddy Vluggen18-Jun-22 13:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.