Rapptz
eedb2a1796
Add key value pair trait
2014-05-31 21:10:42 -04:00
Rapptz
5c8f661447
Allow functions that return C++ sequential containers to return tables on the lua side
2014-05-31 20:02:54 -04:00
Danny
072a88092f
Merge pull request #31 from ThePhD/master
...
Fixed some bad formatting and a missing include guard
2014-05-31 18:11:38 -04:00
ThePhD
9c7e5f0b33
Fixed some bad formatting and a missing include guard.
2014-05-31 18:07:50 -04:00
Danny
be3d0ac27c
Merge pull request #30 from ThePhD/master
...
Fixed segfault on GCC, updated ninja file for easier windows builds (and easier debug builds)
2014-05-31 15:30:36 -04:00
ThePhD
42978a9ed4
Fixed segfault on GCC. It was picking the wrong overload:
...
by forward-declaring the std::function overload in `stack`, it is able to find the right function to use.
All tests are passing
the ninja file has been tweaked to make it easier to invoke a g++ build on windows
2014-05-31 14:29:14 -04:00
Rapptz
08c94e1a67
Renamed demangling function
2014-05-31 06:08:12 -04:00
Rapptz
03f047ed05
Fix compiler error in GCC
2014-05-30 23:35:26 -04:00
Danny
56c6d41134
Merge pull request #27 from ThePhD/master
...
Adding std::function functionality for easier interop, interop with regular C++ classes at C++/lua boundary
2014-05-30 21:02:33 -04:00
ThePhD
0315a43b1b
Userdata-classes are now the assumed type for any unmatching T
which are not derived from sol::reference or not one of the basic types
...
tests added to confirm userdata can be passed into C++ function types
demangle is now named lua_demangle, and the core demangle without any replacements (to fit lua) is just named demangle
Formattings fixes everywhere
2014-05-30 19:58:47 -04:00
ThePhD
a842060e4d
Removed std::true_type/false_type from tuple_types and created a separate is_tuple trait, so that we can use ::type on tuple_types without it interfering with base typedefs in std::true/false_type
...
Fixing some identation
Moved are_same type traits to traits.hpp
2014-05-30 19:10:08 -04:00
ThePhD
854d735410
Additional get_call argument that defaults index to 1 (first argument of stack).
...
tuple_types had overlapping purpose: we should split it up soon
2014-05-30 18:21:19 -04:00
ThePhD
61ecd1c87e
Bug with pop_call when concerning certain argument orders. Popping of the end of the stack was too dangerous, so instead we use a get call and pop all stack arguments off afterwards: helps to preserve order.
2014-05-30 18:20:12 -04:00
ThePhD
fb1eb21f34
Additions for stack to properly handle std::function getters. std::function gets assume that the argument is a lua function and attempt to convert it to the type of function requested by the std::function's signature
2014-05-30 18:19:12 -04:00
ThePhD
5d5ce9cd2e
get
variant to easily get std::function from sol::function when using lua's call syntax.
2014-05-30 15:30:14 -04:00
ThePhD
c85fe4dc95
Merge remote-tracking branch 'root/master'
2014-05-30 15:29:13 -04:00
Rapptz
089b075317
Fix explicit operator bool to be negated is<nil_t>()
2014-05-29 22:19:21 -04:00
ThePhD
3fe8bf9c56
Merge remote-tracking branch 'root/master'
2014-05-29 10:12:53 -04:00
Rapptz
af1f13d582
Allow member functions that return *this to be binded properly. At the moment this means no member function chaining on the lua side
2014-05-29 04:13:24 -04:00
Rapptz
2376dc437b
Stylistic changes to code
2014-05-29 02:57:11 -04:00
ThePhD
065215864b
libstdc++ is literally the dumbest thing in the world and does not properly remove const from types with references
...
Must remove_reference<T> before remove_cv<T>
2014-05-29 02:38:02 -04:00
ThePhD
a8e9c01d0d
Merge remote-tracking branch 'root/master'
2014-05-29 02:32:16 -04:00
ThePhD
c5d43bcfb6
as uses auto and decltype for return type
2014-05-29 02:32:05 -04:00
Rapptz
f9b6cf1595
Add a newline to every sol file missing one
2014-05-29 01:47:27 -04:00
Rapptz
accfd0f7a7
Add explicit operator bool for sol::object for even easier nil checking
2014-05-29 01:28:13 -04:00
Rapptz
54f030873f
Remove reference when creating new reference types on the stack
2014-05-29 01:26:46 -04:00
Danny
2f84be5c5e
Merge pull request #22 from ThePhD/master
...
Fixing Issue #21
2014-05-26 20:16:17 -04:00
ThePhD
b153b34334
Added tests to ensure the derived/base case doesn't slip by us again!
2014-05-25 14:41:06 -04:00
ThePhD
936d52b6e6
main.ninja for compiling with QtCreator on Windows. Really need Shogun...
2014-05-25 14:25:08 -04:00
ThePhD
41e1ca2baa
Additions for gitignore for the new files that are necessary to kick around qtCreator
...
Fix for userdata to accept base classes where the derived class uses the name of a base member function to access it (Derived::get_num, where get_num is only implemented in Base::get_num)
VC++ makes this acceptance easy by taking the name as "Derived", but GCC and Clang
2014-05-25 13:46:23 -04:00
ThePhD
b68a57c65c
Fixed rename mishap
2014-05-25 12:30:44 -04:00
Rapptz
932e29a841
Renamed sol_error to error
2014-05-21 22:24:15 -04:00
Danny
559a77564e
Merge pull request #20 from ThePhD/master
...
Fixing some basic bugs MSVC didn't catch
2014-05-09 20:00:18 -04:00
ThePhD
f17d30592c
Fixing some basic bugs MSVC didn't catch
2014-05-09 19:32:31 -04:00
Danny
f842de2d06
Merge pull request #19 from ThePhD/master
...
Getting userdata out of lua into C++ (after coming from C++ originally)
2014-05-09 18:49:12 -04:00
ThePhD
ff7326ed96
We now have the ability to get a userdata that has been created C++ style out of lua
...
Using `auto` and `decltype` in more places that MSVC can handle it -- using type traits in other places to avoid VC++'s chokes
More flexibility, woo!
2014-05-09 10:48:55 -04:00
ThePhD
d7ea4718c8
multi_return<>
name to return_type<>
.
...
Makes more sense, as the return does not always have to be multiple types.
(Indeed, it is specialized for 1 and 0 cases).
2014-05-08 13:08:21 -04:00
ThePhD
be839bdcd2
We no longer need the register_into(const table& s)
function: removing~
2014-04-27 09:13:45 -04:00
Rapptz
06bda13c86
Add examples for userdata
2014-04-27 05:36:57 -04:00
Rapptz
cd092d3bfb
Add new_userdata to create internally memory managed userdata from sol::state
2014-04-27 05:09:28 -04:00
Rapptz
0ff295f61e
Switch from static member strings to userdata_traits
2014-04-27 05:08:39 -04:00
Rapptz
a2c26a042c
Rename set_class to set_userdata
2014-04-27 04:11:30 -04:00
Rapptz
6a280dc131
Format changes
2014-04-27 03:25:47 -04:00
Rapptz
2f76b96061
Switch member function pointer and string pair in initialisation
2014-04-27 02:35:11 -04:00
Rapptz
b323a62b2a
Fix compiler error with cv-qualifiers on member function pointers
2014-04-27 02:26:06 -04:00
Rapptz
8cd3b18f7b
Fix test failure
2014-04-27 01:29:37 -04:00
Rapptz
b6c2f1c6d5
Fix formatting on tests file
2014-04-27 01:18:54 -04:00
Rapptz
63bc2b06cb
Fix compiler errors, tests failing however
2014-04-27 00:53:57 -04:00
ThePhD
a525760178
Fixed some bad spacing.
2014-04-26 21:38:37 -04:00
ThePhD
0088002abf
Class binding now works with multiple functions
...
Refactoring on function_types.hpp performed to slim down some of the calls: could use more refactoring
Drastically simplified userdata's binding capabilities: constructor supports both `:` and `.` syntax (but member functions DO NOT).
All tests are passing
2014-04-26 18:24:54 -04:00