Add support for returning pointer and reference types from C++ functions registered with lua