>> I also find myself constantly cursing that I have to write an entire 5
>> lines of (nearly identical) code for every arithmetic operation I want
>> to implement and there's no way to abstract this. (I don't have copy &
>> paste available!)
>
> What you could do, is have a function like DoOperation(stack,op), and
> use "op" as a token for the operation.
I wrote a function that returns the top element from the stack while
simultaneously removing it. That cuts down the typing quite a bit.
Note to self: Do *not* attempt to remove an element from an empty vector...
Post a reply to this message
|