Quote:Original post by iMalcQuote:Original post by silvia_steven_2000Ah yes, but many people will just assume you are a troll, and we all know not to feed the trolls.
this is what actuallay I meant to write. I did that by intention.
when u chose a strange title u get your massage read by the max
number of people.
Not all of us do. Take me, for example. I am an idiot(tm). I feed trolls.
Then again, sometimes the troll dies in the feeding, if my cooking is a bit off. So I suppose it's for the common good.
</random>
void simple_example_of_when_smart_pointers_would_be_nice ( void ){ int * this_should_have_been_a_smart_pointer = new int[100]; if(pie && foo) { if (lord_fnordicus_has_returned() && !mariners_win()) { switch (ham_type) { case HAM_WITH_WHIPCREAM: std::cout << "EWWWW" << std::endl; return; //memory leak default: cookie_monster += 12; break; } if (swiss_cheeze) { std::cout << "IT'S CHEESE YOU BUFFOON" << std::endl; swiss_cheese = 1; throw new pie(); //memory leak } else { if (elvis.alive()) return; //edit: I frogot to mark this as amemory leak on the first pass. } } else if (lord_poppeye_has_returned()) { eat_hot_integer_array( this_should_have_been_a_smart_pointer ); } swiss_cheese && (teh_yummeh = 1); lolzorz || (we_are_safe = 1); } else if (pie) { throw std::execption(); //memory leak } else if (foo) { call_some_function_that_will_throw_without_us_realizing_it(); //memory leak } else { sexy_momma = 0; return; //memory leak } delete[] this_should_have_been_a_smart_pointer; //cleanup}