4

Mapping Lua Types to C++

In the previous chapter, we learned how to call a Lua function with a single string argument that returns one string value. In this chapter, we will learn how to call a Lua function with any type and any number of arguments and support multiple return values. To do this, we need to find a convenient way to map Lua types to C++ types. Then, we will build upon this type system to improve our Lua executor step by step. During this process, you will continue to deepen your understanding of the Lua stack and learn how to use some of the modern C++ features to integrate Lua.

In this chapter, we will cover the following topics:

  • Mapping Lua types
  • Supporting different argument types
  • Supporting a variable number of arguments ...

Get Integrate Lua with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.