The operator-overloading tag has no wiki summary.
11
votes
1answer
268 views
Named operators in C++
A post by Yakk alerted me to the idea of named operators in C++. This look splendid (albeit very unorthodox). For instance, the following code can be made to compile trivially:
vector<int> ...
3
votes
1answer
138 views
Implementing C++ boolean function objects with logical operator combinations
I want to make a C++ object hierarchy of "classifiers", which can be composed together via logical operators into a single classifier that implements the whole logical combination.
This is actually ...
5
votes
1answer
236 views
Avoid duplicated += -= operator code
In C++ (and C++11), classes defining a + and += operators often define a - and -= operators that do nearly the same thing (except + is replaced with - in the function).
What is the best way to avoid ...
2
votes
1answer
217 views
Get operator overload method for generics type
I would like to replace the following:
class AdditionEngine<T>
{
public T DoAddition(T x, T y)
{
// use dynamic since the compiler doesn't allow x + y;
dynamic u = x;
...
1
vote
1answer
358 views
Extending string mapping
Basically I'm trying to generalise and extend the notion of mapping one string into another.
There are two methods I often find myself using for this: Functions, and Dictionairies.
So here are my 3 ...
3
votes
1answer
459 views
Custom operator new and operator delete
In our embedded application, we have to replace ::operator new and ::operator delete to call a special malloc(), to ensure that the memory is allocated correctly. The code, written with this guide in ...