Questions tagged [overloading]
The terms overloading and overloaded may refer to: - Constructor and method overloading, a type of polymorphism where different functions with the same name are invoked based on the data types and number of the parameters passed - Operator overloading, a form of functional or method overloading where the action being overloaded is an operator, such as + or -
97 questions
1
vote
0
answers
95
views
Runtime function overloading / dynamic dispatch for Python (2nd revision)
Second revision of the original post: Function overloading / dynamic dispatch for Python
TL;DR:
Improved version of this library[^1] based on previous reviews and criticism. It provides runtime ...
5
votes
2
answers
1k
views
Function overloading / dynamic dispatch for Python
UPDATE: Second revision on separate post. Runtime function overloading / dynamic dispatch for Python (2nd revision)
When I first started using Python I had a rough time dealing with some of it's ...
-2
votes
1
answer
88
views
Initializing an object using a staticmethod
I've an object that looks like this, and users have been populating the attributes post-initialization, e.g.
...
5
votes
1
answer
267
views
uint24_t implementation ported to Windows
I coded stuff for an embedded device where int is 24bits. I wanted to port uint24_t and ...
5
votes
1
answer
216
views
Is there a more idiomatic way than this to use template-generic C++23 multidimensional array subscripts?
C++23 is going to add multidimensional array subscript operators to the language, yippee!
Alas, I have not yet come across a way to adapt them to types where the number of dimensions is templated, so ...
1
vote
2
answers
161
views
A simple String class and its special member functions
I am learning the behavior of C++'s special member function, using a naive String class as example. (The code is modified from this tutorial) Here is the ...
2
votes
1
answer
94
views
API design for Implementing NaN/Unknown values for custom numeric type
I'm gradually writing an arbitrary-precision arithmetic library for C++. I've decided it could be useful to have the default constructor produce an object of indeterminate value, rather than relying ...
4
votes
1
answer
311
views
Comparison operator for ranges C++
If you want to lexicographically compare two vectors in C++, you can simply write vec1 <=> vec2. But instead, if you want to compare them reversed, it is not ...
2
votes
2
answers
339
views
Template Complex class
I have created a class Complex which represents a complex number of any arbitrary arithmetic type. Overloads are given for the 4 common functions, addition, ...
0
votes
1
answer
68
views
Almost identical methods to print an array, differing only by argument type [closed]
It's very basic. I'm learning C# and I want a method to print an array in a readable format. My array could be integers, doubles, or strings. I have implemented method overloading.
From the fact that ...
12
votes
3
answers
2k
views
Matrix implementation
I am trying to implement an optimal and fast running matrix in C++. I need some review of the code and ideas on how to improve the code quality if it shall be.
...
1
vote
1
answer
283
views
Syntax to Overload the Post-Increment Operator ++ as a Nonmember Function
I know this may be a silly question, but... is it really necessary to add the parameter name (int <parameter_name>), instead of just (int) in a definition of an operator function to overload &...
2
votes
1
answer
214
views
Operator overloading in Image class implementation in C++
This is a follow-up question for Dictionary based non-local mean implementation in C++. There are some issues about operators (operator+ and ...
4
votes
3
answers
958
views
C++ money class for basic banking application
I wanted to get my code reviewed as I have tried to implement a basic Money class to represent money values in c++. Can anyone tell me if I am implementing my basic arithmetic operator overloads ...
2
votes
2
answers
556
views
Fractions in C++
I started learning classes and operator overloading in C++. To test my skills I decided to make a Fraction class with all necessary operations.
I would appreciate improvements and suggesstions on my ...