This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

16424250/return-class-pointer-to-lua-with-luabind

By: a guest on May 8th, 2013  |  syntax: C++  |  size: 0.35 KB  |  views: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Block 1:
  2.     void AddValueToP(int aValue)
  3.     {
  4.         g_P->AddValue(aValue);
  5.     }
  6.  
  7.     module(L)
  8.     [
  9.         def("AddValueToP", &AddValueToP)
  10.     ]
  11.  
  12. Block 2:
  13.  
  14.     class P
  15.     {
  16.         public: AddValue(int);
  17.     }
  18.  
  19.     module(L)
  20.     [
  21.         class_<P>("P")
  22.         .def(constructor<>())
  23.         .def("AddValue", &P::AddValue)
  24.     ]
clone this paste RAW Paste Data