satoren / kaguya

C++ binding to Lua
Boost Software License 1.0
345 stars 70 forks source link

Add description how to handle user types #81

Open Flamefire opened 6 years ago

Flamefire commented 6 years ago

The example for adding custom types using std::string is not really helpful.

Could you add an example how to create the correct type_traits for a custom struct?

Example:

struct Foo{
    int bar;
    std::string sBar;
    float fBar;
    std::vector<int> vBar;
};

Or maybe simpler:

struct Point{
    int x, y;
};

Related to #41