Linker error
bauss
jj_1337 at live.dk
Tue Oct 12 11:12:47 UTC 2021
On Tuesday, 12 October 2021 at 00:01:25 UTC, jfondren wrote:
> On Monday, 11 October 2021 at 23:43:17 UTC, Ruby The Roobster
> wrote:
>> package mixin template move__() {
>> pragma(inline) package void mv(Point moveby, ref Skeleton
>> tomove) {
>> foreach(i;tomove.faces) {
>> foreach(k;i.lines) {
>> foreach(j;k.mid_points) {
>> j += moveby;
>> }
>> k.start += moveby;
>> k.stop += moveby;
>> }
>> i.center += moveby;
>> }
>> tomove.center += moveby;
>> }
>> }
>
> It compiles if this `pragma(inline)` is removed.
Not to mention there is no point in marking mv with either
pragma(inline) or package.
It's mixed into the function move(), which means it cannot be
accessed outside of the function anyway, so that makes package
unnecessary.
Inline will probably do nothing as the inline really just tells
the compiler it should inline if it can or wants to, it's not a
guarantee and it probably can't inline the function in this case.
More information about the Digitalmars-d-learn
mailing list