new DIP47: Outlining member functions of aggregates

Iain Buclaw ibuclaw at ubuntu.com
Sat Sep 7 11:03:42 PDT 2013


On 7 September 2013 18:28, Jos van Uden <usenet at fwend.com> wrote:
> On 7-9-2013 19:00, Walter Bright wrote:
>>
>> Outlining of member functions is the practice of placing the declaration
>> of a member function in the struct/class/union, and placing the definition
>> of it at global scope in the module or even in another module.
>>
>> http://wiki.dlang.org/DIP47
>
>
>
> The problem is that it is optional, so when you're reading other people's
> code you'll still have to deal with inline definitions, and you'll need
> a decent editor (doesn't have to be an IDE, even basic editors like
> notepad++ and editpad pro support code folding and function lists) to
> easily read it.

There's no problem here then!


Only two points I'd add to that list are that outlined member
functions declared in external modules:
- Will error if the aggregate or member declaration is not found (eg:
member doesn't exist in aggregate or external module is not imported).
- Are mangled as if from the module where the aggregate member is declared.

Just clarifies some implementation detail.

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list