On Friday, May 13, 2016 18:41:16 Jamal via Digitalmars-d-learn wrote:
> Warning D newb here.
>
> Is it possible to define a member function outside of the
> class/struct like in C++;
>
> class x { body
> void foo(int* i);
> };
>
> void x::foo(int* i){
> *i++;
> }
>
> Or is it just D-like
On 2016-05-13 20:41, Jamal wrote:
Or is it just D-like to define everything inside the class/struct body?
Yes, the D-way is to define everything directly inside the class/struct.
--
/Jacob Carlborg
On 05/13/2016 11:41 AM, Jamal wrote:
Warning D newb here.
Is it possible to define a member function outside of the class/struct
like in C++;
class x { body
void foo(int* i);
};
void x::foo(int* i){
*i++;
}
Or is it just D-like to define everything inside the class/struct body?
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
Warning D newb here.
Is it possible to define a member function outside of the
class/struct like in C++;
class x { body
void foo(int* i);
};
void x::foo(int* i){
*i++;
}
Or is it just D-like to define everything inside the class/struct
body?