« first day (1730 days earlier)      last day (3232 days later) » 

11:00 PM
I think I originally got it from the EA humble bundle
 
Probably
 
Fuck significant whitespace
 
Ell
11:21 PM
I hope I can get install to work tomorrow
It is going to be so l33t
Im going to use vim and i3 and get so many creds
I just need to start watching anime now
 
Hi Everyone.
Please I have a question to ask,

Let's say I have a copy ctor like this:

Data::Data(const Data& newObj) : first(NULL), second(NULL)
{
SetFirst(newObj.first);
SetSecond(newObj.second);
}

Do I really need the initializer list?

With or without it it works, just wondering which is best.
 
Without it if SetFirst throws, second is definitely uninitialized (assuming second and first are raw pointers)
 
@hello What's the implemenetation of SetFirst and SetSecond?
 
SetFirst and SetSecond returns first and second respectively
 
Then Data::Data(Data const&) = default; is best
 
11:31 PM
Set I mean
 
y u no Data::Data(const Data& newObj) : first(other.first), second(other.second) ??
 
I imagined
 
also what @Borgleader said
 
It's pointers so it's broken anyway
 
shut up badfol... oh wait, it's you
 
11:32 PM
@Borgleader Ugh, so redundant
 
Well unless the things are not owned but I somehow doubt that
 
I understand that if POD, I do not need Big 3, but if pointer data member?
Do I need initializer?
in constructor
 
Oh Cat was right after all
 
@hello Show the whole class please
 
@hello You need Rule of Zero
 
11:34 PM
@milleniumbug What rule is that
 
"Write zero C++ code"
9
 
@Jefffrey pastebin.com/A98ML6Jj Here is a header
 
use std::vector
 
He probably wants a queue
 
11:37 PM
@milleniumbug Learning purposes. Data Structur
Structure
 
std::deque
 
@hello Write a std::vector replacement then
If you don't have std::vector, write one or you won't be able to do anything sanely.
 
Ell
Fuck. MBR install doesn't work either
Btrfs y u so hard
Ill never be a hacker :(
 
@milleniumbug I have the 98% of the whole program working, implemented stacks and queues, I was just looking to apply best practice where possible pastebin.com/0uFNasgs
 
@Ell You'll always be an MLG pr0 haXx0r in my book
 
11:40 PM
@hello Using new is not a good practice
Use std::vector
PotionType* orderArray; is not an array
it points to a manually managed array
 
@milleniumbug Dynamic array?
 
1 min ago, by milleniumbug
Use std::vector
 
@milleniumbug I cant for this assignment. As per instructors demands.
 
4 mins ago, by milleniumbug
If you don't have std::vector, write one or you won't be able to do anything sanely.
 
@milleniumbug I thought pastebin.com/0uFNasgs was an implentation using stacks and queues?
 
11:43 PM
IOW instead of making sure your Apothecary class works correctly wrt to Rule of Three
write a class that manages an array
and compose it with your Apothecary class
You're violating Single Responsibility Principle - your Apothecary class manages orders, potions and invariants of queues
 
@sehe I found another legit reason just now to answer alot. Because reputation leads to jobs if you open an account in stack overflow careers which means money :D
higher reputation, more jobs i guess
 
@milleniumbug I have a potion class. Object from potion is inserted into queue implemented by Apothecary
 
@sehe possible reason*
 
@hello Rip out your stack and queue implementation out of Apothecary class and move them into their respective Stack and Queue classes
 
@milleniumbug Makes sense. Would work on that.
 
11:50 PM
Not only you'll simplify the logic of the Apothecary class, you'll make debugging easier.
 
@milleniumbug Okay. Any other issue you spotted in the code?
 
10 mins ago, by milleniumbug
1 min ago, by milleniumbug
Use std::vector
 
@hello Using copy-and-swap idiom is an excellent idea, but you don't do any copies
See the line 65, and make the assignment operator take Apothecary by value
 
@milleniumbug Like this Apothecary& operator=(Apothecary NewApo);
 
yeah
 
11:55 PM
any reason for that? Why not a reference?
 
(also you won't need this code in Apothecary if you do your job well with moving the responsibilities of queue and stack to their classes)
@hello Because you're currently modifying the right-hand side.
You wouldn't expect a in int a = 42; int b = 0; b = a; to be 0, would you?
 
@milleniumbug Absolutely not.
Makes sense now.
 

« first day (1730 days earlier)      last day (3232 days later) »