First D project, problem with error messages

evilrat evilrat666 at gmail.com
Sat Feb 11 05:53:38 UTC 2023


On Saturday, 11 February 2023 at 05:28:11 UTC, Walter Bright 
wrote:
> On 2/9/2023 11:42 AM, Steven Schveighoffer wrote:
>> Having no parameters has limited use, mostly to allow it to be 
>> a mixin template, or to prevent it from being included in the 
>> binary unless it's used.
>
> Adding () to functions turns them into templates, which can be 
> be advantageous if you want the compiler to infer the 
> return/scope attributes automatically.

It also can be used in header-only kind of libraries (a bindings 
for example) for a helper functions, that otherwise will require 
linking that library in addition to the original library, which 
can be very annoying.


More information about the Digitalmars-d mailing list