lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 16/03/2014 4:26 AM, Jeremy Ong wrote:
I've been working on a Lua library recently that uses classes, but other
than that I've avoided C++ features (such as templates and the STL) for fear
that I don't want my library to depend on a huge C++ runtime. I hope I
haven't got it all wrong... Classes are damn nice to have (and templates
would be nice too), but I don't want to drag in all of the STL and have my
library be potentially unusable on small devices.
You realize templates are a compile-time thing right?

And use of templates usually produces much larger object code when compared to C. Every time you use std::string the compiler will generate lots of code.
Hence C++11 and extern templates (a very useful new feature).