The overloading tag has no wiki summary.
2
votes
1answer
48 views
Implementing binary output to a file in C++11
I would like to have a class which supports outputting bits into a file. This is what I came up with but I fear there are many poor decisions. Should I inherit from a ...
3
votes
2answers
94 views
Emulating __uint128_t
I developed a lot of code locally with __uint128_t only to find out that it is not available on the target platform.
I am now trying to write my own struct that ...
5
votes
1answer
87 views
Multiple dispatch decorator classes in Python
This is based on my first review and the suggested points in "Multiple dispatch decorator in Python":
...
21
votes
4answers
1k views
Standardly deviated Fibonacci
I'm new to C++ (about 4 weeks with no prior programming experience in other languages) and am writing a program that's supposed to do the following:
Define an array of 100 sequential numbers of type ...
5
votes
2answers
104 views
Providing const- and non-const overloads of a strstr() implementation
In a question about reimplementing strstr(), I posted an answer. I pointed out a need for const- and non-const versions of the function, and provided ...
4
votes
2answers
455 views
How do I avoid duplicated code in these overloaded functions?
I have the following overloaded functions. All the code is the same as except for their format (%s v.s %lu), so I couldn't use ...
5
votes
2answers
178 views
Overloading operators in PhoneCall class
I am trying to understand the concepts of friend functions, overloaded operators, and inheritance in C++. I am very confused on the specifics used for coding, since ...
2
votes
1answer
115 views
Grails overloaded controller workaround
I had an overloaded method, but Grails doesn't allow overloaded methods in controller actions. The overloaded method looked like this:
...
3
votes
1answer
157 views
Review of 2d Vector class
I'll keep this short. I've never actually done professional C++. I don't really know any of the 'best practices'. I'd like to get some review on a simple class that I've made.
My Vector2d.h file:
...
7
votes
2answers
974 views
Generic Calculator and Generic Number
.NET does not support generic numbers. It is not possible to enforce a generic method with generic argument T that T is a number. The following code will simply not compile:
...
27
votes
1answer
1k 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:
...
4
votes
1answer
225 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 ...
7
votes
1answer
278 views
Avoid duplicated += -= operator code
In C++ (and C++11), classes defining a + and += operators often define a - and ...
3
votes
0answers
1k views
1
vote
1answer
727 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 ...
4
votes
1answer
1k views
Custom operator new and operator delete
In our embedded application, we have to replace ::operator new and ::operator delete to call a special ...