On 5/13/16 2:41 PM, Jamal wrote:
Warning D newb here.

Is it possible to define a member function outside of the class/struct
like in C++;

Not within the same file.

You can have an "interface file", extension .di, which hides the bodies of functions. But inside the implementation file, you must repeat the class/struct definition. So it's a lot of extra work. The compiler can spit out a .di file based on your implementation with the bodies hidden, but it's not perfect.

You also can't hide template function bodies.

What is your use case, or is it just that you prefer doing it that way?

-Steve

Reply via email to