On 1/30/11, Dan Olson <zans.is.for.c...@yahoo.com> wrote:
> dennis luehring <dl.so...@gmx.net> writes:
>
>>> They're useful for testing:
>>>
>>> unittest {
>>>     int foo();
>>>     static assert (is(ReturnType!foo == int));
>>> }
>>
>> and else? is it worth?
>
> Don't class function declarations have the same issue?  You can declare
> but all you'll get is a link error.  Unless there some way like C++ to
> provide a definition elsewhere.
>
> class C
> {
>    int foo();
> }
>
> void main()
> {
> }
>

I think we've forgotten about D header files. (*.di). If a company
doesn't want to share the source code but allows static linking to its
libraries, providing .di header files is the way to go. The above code
would be valid in a .di file AFAIK.

Reply via email to