nested function overloading

Steven Schveighoffer schveiguy at gmail.com
Mon Jun 20 13:20:51 UTC 2022


On 6/17/22 8:09 AM, Chris Katko wrote:
> I don't need this functionality, but I wanted to be sure.
> 
> Does function overloading not work with nested functions? I got a 
> compiler error (something like "function already defined") when I tried it.

Correct, it's not allowed.

However, you can define a function template to get effectively 
overloading based on parameter type.

And you can also use an inner struct to define overloaded functions.

-Steve


More information about the Digitalmars-d-learn mailing list