Getting rid of dynamic polymorphism and classes

DypthroposTheImposter mcbracket at gmail.com
Thu Nov 8 09:50:47 PST 2012


I also don't really like inheritance based design but..

That example would crash hard if those stack allocated shapes 
were not in scope...

Making it work safely would probably require std::shared_ptr usage

So it uses way more memory per object(BAD)

  Just use a dynamic language like Lua, it doesn't have classes, 
you example would be dead simple in lua.






More information about the Digitalmars-d mailing list