Commit Graph

94 Commits

Author SHA1 Message Date
ThePhD
7af3fc4ffa Added nullopt pushing, optional pushing, improved tests 2016-03-30 16:52:51 -04:00
ThePhD
92c388e30a And nooow we're set for optional. Totally. With the get_or implementation as well. Hopefully this will be all we need. 2016-03-30 01:40:40 -04:00
ThePhD
9804d7dd63 Merge remote-tracking branch 'zwparchman/develop' into develop 2016-03-30 00:34:05 -04:00
ThePhD
5acb33e2bc full-on optional support. so much support it's coming through my eyeballs. Goodness.
Support for c_call wrapper to be a thing.
2016-03-30 00:31:18 -04:00
Zachary
6637f2e1b7 Added table::get_with_default method
There is now a sol::table::get_with_default method that takes 2
arguments, one being the key to search on, the other being the default.
If the key does not have a value in the table the default value is
returned.
2016-03-29 13:03:19 -05:00
ThePhD
a0fdaaaa7d Full-on optional support. 2016-03-25 10:39:54 -04:00
ThePhD
68660a1bed Allow for checking whether or not a given proxy is valid. 2016-03-25 05:27:19 -04:00
ThePhD
09a0a5051a Documentation updates and new stack::check_get API. 2016-03-24 15:45:44 -04:00
ThePhD
f43adf9a3d Additional function creation tables and tests to keep them there. 2016-03-15 07:32:59 -04:00
ThePhD
d52bc23f53 Mooooar tests. And better support for proxy and tuples. 2016-03-15 06:36:25 -04:00
ThePhD
62f082d999 documentation fixes from feedback and fixes! 2016-03-14 02:34:02 -04:00
ThePhD
c42c1bafe5 Documentation fixes, new tests, unique/shared_ptr support.
Closes #32
2016-03-13 08:30:14 -04:00
ThePhD
1a9c7484b1 Fix up the API; prepare for release. 2016-03-11 11:34:44 -05:00
ThePhD
d883ad072c Ooops. 2016-03-02 21:07:19 -05:00
ThePhD
8827751c20 trampoline fx for gcc 4.9 needs some implicit conversion help. 2016-03-02 21:05:01 -05:00
ThePhD
923c774d5e ability for functions that throw not bound by sol to catch and return lua errors that can be used by a handler function (for protected function). 2016-03-02 20:45:52 -05:00
ThePhD
4ed197f065 formatting 2016-02-27 08:04:02 -05:00
ThePhD
d42efd7fdf Proper trampolines to allow luajit to play nice with all the other kids in sol. 2016-02-27 07:56:28 -05:00
ThePhD
251e350539 coroutines \o/ 2016-02-27 02:43:53 -05:00
ThePhD
2d845a273d Invert conditional, 'cause I'm a dumb. 2016-02-25 13:29:37 -05:00
ThePhD
1341aafa27 Unfortunately, exceptions require some overhead in luajit... overhead we can't always accept on behalf of the user. 2016-02-25 13:04:04 -05:00
ThePhD
f9da62a6e3 g++ 4.8 can't handle raw string literals in macros... that's rough. 2016-02-25 03:51:29 -05:00
ThePhD
51cd0cb0da Messed up the spacing like a pleb 2016-02-24 14:10:22 -05:00
ThePhD
9c21d11b8c Proper defaults for bootstrap.py
Checks in g++ to make sure things compile
clang++ is a major asshole...
2016-02-24 13:59:17 -05:00
ThePhD
16c6f62fe3 Remove strerror deprecation remark 2016-02-22 02:44:27 -05:00
ThePhD
019c7b037b Huge improvements to the library and fixes to compile in g++.
usertype now respects factory functions and does not make default constructors/destructors unless the compiler says its okay
new and __gc functions can be overridden for usertypes to provide handle-like creation and deletion functions
Overloading match fixes
RAII improvements for all usertypes
Added tests to make sure these features stay
2016-02-21 19:26:58 -05:00
ThePhD
b2b73db5cb overloading searching improvements and general refactoring for cleaner implementation. 2016-02-18 22:17:52 -05:00
ThePhD
1293213775 Several improvements to tunnneling for the library, with included tests
Some stack size tests are also included to prevent stack overflow as well.
2016-02-13 20:14:31 -05:00
ThePhD
17c8f8e04d Mo' problems, mo' tests. 2016-02-12 12:56:32 -05:00
ThePhD
228609ee17 Addresses derp from refactoring and #12 2016-02-12 12:47:05 -05:00
ThePhD
427194bc92 Improved functions example and adjusted all errors for g++ conformance with -Wall -Werror 2016-02-10 12:12:09 -05:00
ThePhD
2788abb34e Overloading now works and there are tests to back it up. The codebase now relies on some C++14 features explicitly. 2016-02-10 11:36:00 -05:00
ThePhD
b66c7f015a Significant change to how userdata is stored to make access consistent across values/references/pointers. 2016-02-01 11:56:44 -05:00
ThePhD
1d93f560f2 more luajit compatibility fixes - works with Lua 5.1, 5.2, 5.3
additional tests to make sure pass-by-value and copy semantics work as intended
new proxy_base class to reduce code duplication
update function / protected_function usage (to solve starwing's issue while keeping code as clean as possible)
2016-02-01 03:27:06 -05:00
ThePhD
9ff968a09b Heavily improved benchmark and first set of optimizations to sol/table.hpp, providing much lower access times for calling a function. 2016-01-08 16:16:06 -05:00
ThePhD
3e17b24065 static members are hard to deal with in regular memory...
Also, make sure tuple returns don't get shafted by the tuple_types machinery!
2015-10-25 07:44:17 -04:00
ThePhD
e84cf66683 decay to std::string instead of char*, as its both safer (protects against early stack pops) and is handled better by g++'s new std::string conversion constructors
Make sure we're only using C++11 features (no decltype(auto))
2015-10-25 06:48:19 -04:00
ThePhD
34af96214b tests for the lua call error handling functions... 2015-10-23 02:54:26 -04:00
ThePhD
dbeb8b5fcb tests for the new decaying functionality
need to test with clang++/g++ to see if it still works
2015-07-22 02:54:43 -04:00
ThePhD
ffcd1f557b Some derps on the compatibility arguments
checkargs is now properly propogated through the "call" functions
tests now define SOL_CHECK_ARGUMENTS to make sure
the tests will always check arguments now as well (caught one minor implementation detail missing from that!)
2015-06-17 18:33:58 -04:00
ThePhD
712afc924f Conversions from nil to nullptr and vice-versa now properly work
Fix for really bad derp in metamethod registration
2015-05-27 02:23:37 -04:00
ThePhD
184f16d7fa Updated copyright headers and added compatibility with lua 5.1.5 and luajit!
This means sol can now run on the fastest dynamic language implementation ever!
Wooo!~
2015-05-24 21:29:21 -04:00
ThePhD
e816d07121 Standard-compliant function signature deduction (cannot use set_function<Args...> format as that creates an ambiguity)
state now has for_each (runs on global table like all other functions)
added for_each tests, per @Rapptz request
2015-05-15 22:26:18 -04:00
ThePhD
bd4492b85b This mega-commit introduces Visual Studio 2015 CTP 6 support.
sol::object had a few reference leaks in the way it retrieved values: it now does it properly without leaving the stack at +1 item
sol::stack was drastically cleaned up, with the following key change:
    * sol::stack::push now returns an integer of the number of things its pushed (usually 1, but can be more) (Thanks, @PrincessNyanara!)
    * sol::stack::call now calls functions flexibly, and getting is done more reliably
    * due to the innovation of stack::call and using absolute indices, we no longer have to use reverse_call style programming to deal with lua
    * sol::reference::get_type is now const-correct
    * sol::state and sol::table now have a cleaned up `get` implementation since it is no longer held back by the ugliness of VC++'s incapability to handle templates
    * the name `sol::userdata` now belongs to a type that actually encapsualtes a void* with a pusher/getter than gets a userdata void* value (TODO: give it a template to make it static_cast to that type on get?)
    * lightuserdata_t -> light_userdata, upvalue_t -> upvalue as type names (mostly details)
    * pushers for various types were updated to return integers
2015-03-01 21:14:42 -05:00
ThePhD
0373dd4eb2 Change userdata to usertype names.
We don't need to make the function names
`open_usertype` now, since `new_usertype`
makes sense.
2014-09-19 08:22:21 -04:00
ThePhD
6121da334f Proper std::ref semantics throughout the codebase's get/set.
Also a convenience type `sol::ref`, which is just an
alias to `std::reference_wrapper`, to enable easy getting with `lua.get<>`
(we can't use `lua.get<some_type>` because of necessary `Unqualified<T>` use)
2014-09-18 00:23:46 -04:00
Rapptz
0a2050769c Remove local from variable in test. 2014-09-07 01:06:08 -04:00
Rapptz
e015dace71 Add regression tests for issue #48. 2014-09-05 16:06:48 -04:00
ThePhD
37c3883eb6 Free functions and lambdas whos first arguments match the userdata type (unqualified)
now are usable as functions for userdata.
allows free functions and lambdas to provide useful operations, like operator+*-/
and other things which may not be implemented as class members.
2014-08-09 04:54:58 -07:00
ThePhD
63e66a40c2 Fix clang builds due to being unable to use shortcut-syntax for overloaded. You must specify the whole signature (how droll). 2014-08-05 09:07:29 -07:00