Questions tagged [overloading]

Use this tag for questions about function or method overloading, where multiple definitions may be created with the same name and the language defines rules for which is referred to at any use. Do not use for performance questions about overloaded machines.

Filter by
Sorted by
Tagged with
3 votes
1 answer

Concept Overloading in C++

The meaning of function overloading is that two or more functions can have the same name but different parameters. In C++20, concept has been introduced. I found ...
JimmyHu's user avatar
  • 133
13 votes
10 answers

Are there any practical use cases for subtyping primitive types?

In, for example, Python, it is possible to subtype primitive types: ...
Wheelwright's user avatar
3 votes
1 answer

Declaration-site vs use-site overloading

By overloading, I mean allowing multiple type members that seem to conceptually do the same thing to use the same name, but possibly with different representations of the inputs. ...
Mike Samuel's user avatar
5 votes
5 answers

What are the alternatives to classic ad hoc function overloading?

In most languages that support function overloading, this is done rather ad hoc. To create a set of overloaded function you simply define all functions in that desired set with the same name in the ...
ratchet freak's user avatar
15 votes
1 answer

Pros and cons of overloading vs type classes or similar polymorphism

I'm playing with creating a language after doing the LLVM Kaleidoscope tutorial. I've added some basic type checking, and now I want to add some functions that write things to standard output, as must ...
Rob N's user avatar
  • 1,073