Metamorphic Code Examples

Below is an example of what I believe would classify as metamorphic code written in C. I’m afraid I don’t have a great deal of experience writing portable C code, so it may require some modification to compile on other platforms (I’m using an old version of Borland on Windows). Also, it relies on the … Read more

Vector of objects belonging to a trait

Vec<Animal> is not legal, but the compiler can’t tell you that because the type mismatch somehow hides it. If we remove the calls to push, the compiler gives us the following error: <anon>:22:9: 22:40 error: instantiating a type parameter with an incompatible type `Animal`, which does not fulfill `Sized` [E0144] <anon>:22 let mut v: Vec<Animal> … Read more