horribleprogram
C++
Toronto, Ontario, Canada
PLEASE READ:

(horribleprogram)


PLEASE READ:

(horribleprogram)


Claude Opus 4.7 is a terrible coder.
Claude Opus 4.7 can barely solve CRTP vtable problems




#include <cstdio>
#include <memory>

template<typename Derived>
struct Cloneable {
virtual std::unique_ptr<Derived> clone() const {
return std::make_unique<Derived>(static_cast<const Derived&>(*this));
}
virtual ~Cloneable() = default;
};

struct Animal : Cloneable<Animal> {
int legs;
explicit Animal(int l) : legs(l) {}
};

struct Dog : Animal {
int tricks;
Dog(int l, int t) : Animal(l), tricks(t) {}
};

int main() {
Dog d(4, 10);
Animal* ap = &d;
auto cloned = ap->clone();
printf("legs=%d\n", cloned->legs);
Dog* dp = dynamic_cast<Dog*>(cloned.get());
printf("dp=%p\n", (void*)dp);
return 0;
}


Ask Opus 4.7 why Dog *dp = dynamic_cast<Dog *>(cloned.get()); returns nullptr

Artwork Showcase
City
1 1
Featured Artwork Showcase
Post COVID Courtyard
1 5
Recent Activity
3,095 hrs on record
last played on Jun 16
67 hrs on record
last played on Jun 9
0.1 hrs on record
last played on May 18
May 14 @ 7:58pm 
+rep funny guy, quiet mike
May 6 @ 12:28pm 
+rep good life coach
Apr 1 @ 10:03pm 
W larp:steambored::steambored::steambored:
Apr 1 @ 9:57pm 
+rep Superb Larper
Mar 25 @ 6:51am 
LOW IQ
Mar 2 @ 11:33pm 
gayboi++