amanjeetsingh150 / kotlin-android-examples

:muscle: [Examples] Isolated applications purely on Kotlin, for all android devs out there
1.06k stars 288 forks source link

I just can't find any other way to tell you this #18

Open Orisphera opened 9 months ago

Orisphera commented 9 months ago

UPD: I thought this was a repo by oiyio

This is not an issue with the repository. This is an issue with something unrelated. I'm posting it here because I can't find any other way to communicate with you. If my assumptions are correct, I think you should understand it from the following:

#include <iostream>
#include <memory>

class Primer2;

class Primer1 {
    public:
        int x;
        void x_from(Primer1 x);
        void x_from(Primer2 x);
        void out();
};

class Priner2 {
    public:
        char x;
        void x_from(Primer1 x);
        void x_from(Primer2 x);
        void out();
};

int main() {
    std::cout << sizeof(Primer1) << ' ' << sizeof(Primer2) << '\n';
}

void Primer1::x_from(Primer1 x) {
    this->x = x.x;
}

void Primer1::x_from(Primer2 x) {
    this->x = x.x;
}

void Primer1::out() {
    std::cout << this->x;
}

void Primer2::x_from(Primer1 x) {
    this->x = x.x;
}

void Primer2::x_from(Primer2 x) {
    this->x = x.x;
}

void Primer2::out() {
    std::cout << this->x;
}

Compile it with g++ and see the first error.