Hacker News new | ask | show | jobs
by dinglejungle 1801 days ago
> Why would operator overloading allocate memory?

What if I wanted to overload the + operator to concatenate strings?

1 comments

Yes that was poorly thought out. I realized it after i commented.

There is definitely some merit in being puritanical about not having any allocations in operators.