Click here to Skip to main content
15,887,083 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
#realJSOP18-Jun-22 23:14
mve#realJSOP18-Jun-22 23:14 
GeneralRe: Not So Satisfying Weekend... Pin
Eddy Vluggen18-Jun-22 11:25
professionalEddy Vluggen18-Jun-22 11:25 
QuestionPointers and brain drain Pin
honey the codewitch18-Jun-22 1:47
mvahoney the codewitch18-Jun-22 1:47 
AnswerRe: Pointers and brain drain Pin
Amarnath S18-Jun-22 1:52
professionalAmarnath S18-Jun-22 1:52 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 1:58
mvahoney the codewitch18-Jun-22 1:58 
GeneralRe: Pointers and brain drain Pin
harold aptroot18-Jun-22 2:38
harold aptroot18-Jun-22 2:38 
AnswerRe: Pointers and brain drain Pin
Richard MacCutchan18-Jun-22 2:41
mveRichard MacCutchan18-Jun-22 2:41 
AnswerRe: Pointers and brain drain Pin
Greg Utas18-Jun-22 2:51
professionalGreg Utas18-Jun-22 2: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 3:24
professionalDavid O'Neil18-Jun-22 3:24 
GeneralRe: Pointers and brain drain Pin
Mircea Neacsu18-Jun-22 5:04
Mircea Neacsu18-Jun-22 5:04 
AnswerRe: Pointers and brain drain Pin
Gerry Schmitz18-Jun-22 4:32
mveGerry Schmitz18-Jun-22 4:32 
AnswerRe: Pointers and brain drain Pin
jmaida18-Jun-22 4:57
jmaida18-Jun-22 4:57 
AnswerRe: Pointers and brain drain Pin
Greg Utas18-Jun-22 4:57
professionalGreg Utas18-Jun-22 4:57 
QuestionRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 11:30
professionalEddy Vluggen18-Jun-22 11:30 
AnswerRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 11:35
mvahoney the codewitch18-Jun-22 11:35 
GeneralRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 12:06
professionalEddy Vluggen18-Jun-22 12:06 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 12:10
mvahoney the codewitch18-Jun-22 12:10 
GeneralRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 12:33
professionalEddy Vluggen18-Jun-22 12:33 
GeneralRe: Pointers and brain drain Pin
Greg Utas18-Jun-22 12:56
professionalGreg Utas18-Jun-22 12:56 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 17:03
mvahoney the codewitch18-Jun-22 17:03 
GeneralRe: Pointers and brain drain Pin
jmaida18-Jun-22 18:05
jmaida18-Jun-22 18:05 
GeneralRe: Pointers and brain drain Pin
jmaida18-Jun-22 18:12
jmaida18-Jun-22 18:12 
GeneralRe: Pointers and brain drain Pin
honey the codewitch18-Jun-22 19:09
mvahoney the codewitch18-Jun-22 19:09 
AnswerRe: Pointers and brain drain Pin
jmaida18-Jun-22 11:38
jmaida18-Jun-22 11:38 
QuestionRe: Pointers and brain drain Pin
Eddy Vluggen18-Jun-22 12:28
professionalEddy Vluggen18-Jun-22 12: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.