Relative Content

Tag Archive for operators

Why isn’t the arrow operator in C++ just an alias of *.?

In c++, the * operator can be overloaded, such as with an iterator, but the arrow (->) (.*) operator does not work with classes that overload the * operator. I imagine that the preprocessor could easily replace all instances of -> with (*left).right, and that would make iterators nicer to implement. is there a practical reason for -> to be different, or is that just a peculiarity of the language/designers?

Overloading Operators – C++

I was experimenting with new overloaded operators, I have created one void operator and another one that returns something when it’s called:

Which are the fundamental stack manipulation operations?

I’m creating a stack oriented virtual machine, and so I started learning Forth for a general understanding about how it would work. Then I shortlisted the essential stack manipulation operations I would need to implement in my virtual machine:

Why aren’t user-defined operators more common? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Closed 3 years ago. Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. One feature I miss in from functional languages is the idea that operators are […]