Commit Graph

22 Commits

Author SHA1 Message Date
ThePhD
0e19156d52 update everything for the new cmake build, prepare for new .travis.yml and new appveyor.yml
Add name of project at top of license
fix container_traits with respect to boost::property_tree: Fixes #554
fix as_table with a vector of tuples (forward_get ignored constness): Fixes #552
2017-12-20 04:58:50 -05:00
ThePhD
5816c6c34b .clang-format the crap out of everything, I guess...! 2017-09-13 02:46:56 -04:00
ThePhD
34b81bef6b Handle qualified name failures of VC++, where using templates do not match the fully qualified names of what they alias to (Thanks, VC++) 2017-05-15 10:41:50 -04:00
ThePhD
26b85c8136 Make sure resolve works and provide some protection against deleting the handler that originates from a specific sol::state. sol::state_view users will be left out in the dark, though. 2016-12-26 13:50:08 -05:00
ThePhD
b2d137f65f change resolve to behave better with crappy clang 2016-11-14 21:39:26 -05:00
ThePhD
f5930bfa48 constexpr resolve 2016-11-14 13:58:55 -05:00
ThePhD
556be8da98 Documentation updates -- require function and add function and size function needed documentation
New `add` function as requested by @EliasD
2016-06-19 17:59:40 -04:00
ThePhD
3b81a7c85f VC++ is a butt, but this Closes #91
It prepares for #97 as well, and blocks out #95 until I can be assed
Now, it's either performance or handling sol::property ...
2016-05-19 02:15:42 -04:00
ThePhD
97e36f70c5 Alright, NOW everything's kosher. Bwuh, byte order marks... 2016-03-14 09:53:24 -04:00
ThePhD
251e350539 coroutines \o/ 2016-02-27 02:43:53 -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
3d7a93ae1c Put detail classes not part of the interface into deeper namespaces to clear up the to level. 2016-02-23 23:39:46 -05:00
ThePhD
5034bd7980 Benchmarking will be done in a separate repository, alongside other frameworks. 2016-02-04 20:16:53 -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
31e7857870 Merge remote-tracking branch 'root/develop' into develop
# Conflicts:
#	examples/usertype.cpp
#	sol.hpp
#	sol/debug.hpp
#	sol/default_construct.hpp
#	sol/demangle.hpp
#	sol/deprecate.hpp
#	sol/error.hpp
#	sol/function.hpp
#	sol/function_types.hpp
#	sol/object.hpp
#	sol/proxy.hpp
#	sol/reference.hpp
#	sol/resolve.hpp
#	sol/stack.hpp
#	sol/state.hpp
#	sol/table.hpp
#	sol/traits.hpp
#	sol/tuple.hpp
#	sol/types.hpp
#	sol/usertype.hpp
#	sol/usertype_traits.hpp
2016-01-24 12:16:38 -05:00
ThePhD
93d532094e object is now more flexible while still supporting the same semantics
indentation an spacing fixes for everything
2015-10-20 21:38:28 -04:00
Rapptz
38d03eef6e Update copyright year. 2015-07-21 19:51:17 -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
Rapptz
a2237eb068 Fix lack of inline in functions.
diff --git a/bootstrap.py b/bootstrap.py
index c24f6e5..1d6a0b3 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -37,6 +37,7 @@ parser = argparse.ArgumentParser()
 parser.add_argument('--debug', action='store_true', help='compile with debug flags')
 parser.add_argument('--cxx', metavar='<compiler>', help='compiler name to use (default: g++)', default='g++')
 parser.add_argument('--ci', action='store_true', help=argparse.SUPPRESS)
+parser.add_argument('--testing', action='store_true', help=argparse.SUPPRESS)
 parser.add_argument('--lua-dir', metavar='<dir>', help='directory lua is in with include and lib subdirectories')
 parser.add_argument('--install-dir', metavar='<dir>', help='directory to install the headers to', default=install_dir);
 parser.epilog = """In order to install sol, administrative privileges might be required.
@@ -80,6 +81,9 @@ if args.ci:
 else:
     ldflags.extend(libraries(['lua']))

+if args.testing:
+    cxxflags.append('-Wmissing-declarations')
+
 if 'linux' in sys.platform:
     ldflags.extend(libraries(['dl']))

diff --git a/sol/demangle.hpp b/sol/demangle.hpp
index 694a2be..78f4dd4 100644
--- a/sol/demangle.hpp
+++ b/sol/demangle.hpp
@@ -33,12 +33,12 @@
 namespace sol {
 namespace detail {
 #ifdef _MSC_VER
-std::string get_type_name(const std::type_info& id) {
+inline std::string get_type_name(const std::type_info& id) {
     return id.name();
 }

 #elif defined(__GNUC__) || defined(__clang__)
-std::string get_type_name(const std::type_info& id) {
+inline std::string get_type_name(const std::type_info& id) {
     int status;
     char* unmangled = abi::__cxa_demangle(id.name(), 0, 0, &status);
     std::string realname = unmangled;
@@ -50,7 +50,7 @@ std::string get_type_name(const std::type_info& id) {
 #error Compiler not supported for demangling
 #endif // compilers

-std::string demangle(const std::type_info& id) {
+inline std::string demangle(const std::type_info& id) {
     std::string realname = get_type_name(id);
     const static std::array<std::string, 2> removals = {{ "struct ", "class " }};
     const static std::array<std::string, 2> replacements = {{ "::", "_" }};
diff --git a/sol/resolve.hpp b/sol/resolve.hpp
index 0d849d0..1f6f606 100644
--- a/sol/resolve.hpp
+++ b/sol/resolve.hpp
@@ -28,66 +28,67 @@
 namespace sol {
 namespace detail {
 template<typename R, typename... Args, typename F, typename = typename std::result_of<Unqualified<F>(Args...)>::type>
-auto resolve_i(types<R(Args...)>, F&&)->R(Unqualified<F>::*)(Args...) {
+inline auto resolve_i(types<R(Args...)>, F&&) -> R(Unqualified<F>::*)(Args...) {
     using Sig = R(Args...);
     typedef Unqualified<F> Fu;
     return static_cast<Sig Fu::*>(&Fu::operator());
 }

 template<typename F, typename U = Unqualified<F>>
-auto resolve_f(std::true_type, F&& f) -> decltype(resolve_i(types<function_signature_t<decltype(&U::operator())>>(), std::forward<F>(f))) {
+inline auto resolve_f(std::true_type, F&& f)
+-> decltype(resolve_i(types<function_signature_t<decltype(&U::operator())>>(), std::forward<F>(f))) {
     return resolve_i(types<function_signature_t<decltype(&U::operator())>>(), std::forward<F>(f));
 }

 template<typename F>
-void resolve_f(std::false_type, F&&) {
+inline void resolve_f(std::false_type, F&&) {
     static_assert(has_deducible_signature<F>::value,
                   "Cannot use no-template-parameter call with an overloaded functor: specify the signature");
 }

 template<typename F, typename U = Unqualified<F>>
-auto resolve_i(types<>, F&& f) -> decltype(resolve_f(has_deducible_signature<U> {}, std::forward<F>(f))) {
+inline auto resolve_i(types<>, F&& f) -> decltype(resolve_f(has_deducible_signature<U> {}, std::forward<F>(f))) {
     return resolve_f(has_deducible_signature<U> {}, std::forward<F>(f));
 }

 template<typename... Args, typename F, typename R = typename std::result_of<F&(Args...)>::type>
-auto resolve_i(types<Args...>, F&& f) -> decltype( resolve_i(types<R(Args...)>(), std::forward<F>(f))) {
+inline auto resolve_i(types<Args...>, F&& f) -> decltype( resolve_i(types<R(Args...)>(), std::forward<F>(f))) {
     return resolve_i(types<R(Args...)>(), std::forward<F>(f));
 }

 template<typename Sig, typename C>
-Sig C::* resolve_v(std::false_type, Sig C::* mem_func_ptr) {
+inline Sig C::* resolve_v(std::false_type, Sig C::* mem_func_ptr) {
     return mem_func_ptr;
 }

 template<typename Sig, typename C>
-Sig C::* resolve_v(std::true_type, Sig C::* mem_variable_ptr) {
+inline Sig C::* resolve_v(std::true_type, Sig C::* mem_variable_ptr) {
     return mem_variable_ptr;
 }
 } // detail

 template<typename... Args, typename R>
-auto resolve(R fun_ptr(Args...)) -> R(*)(Args...) {
+inline auto resolve(R fun_ptr(Args...)) -> R(*)(Args...) {
     return fun_ptr;
 }

 template<typename Sig>
-Sig* resolve(Sig* fun_ptr) {
+inline Sig* resolve(Sig* fun_ptr) {
     return fun_ptr;
 }

 template<typename... Args, typename R, typename C>
-auto resolve(R(C::*mem_ptr)(Args...)) -> R(C::*)(Args...) {
+inline auto resolve(R(C::*mem_ptr)(Args...)) -> R(C::*)(Args...) {
     return mem_ptr;
 }

 template<typename Sig, typename C>
-Sig C::* resolve(Sig C::* mem_ptr) {
+inline Sig C::* resolve(Sig C::* mem_ptr) {
     return detail::resolve_v(std::is_member_object_pointer<Sig C::*>(), mem_ptr);
 }

 template<typename... Sig, typename F>
-auto resolve(F&& f) -> decltype(detail::resolve_i(types<Sig...>(), std::forward<F>(f))) {
+inline auto resolve(F&& f) -> decltype(detail::resolve_i(types<Sig...>(), std::forward<F>(f))) {
     return detail::resolve_i(types<Sig...>(), std::forward<F>(f));
 }
 } // sol
2014-08-10 21:07:19 -04:00
Rapptz
da76793c30 Formatting changes. 2014-08-10 20:49:34 -04:00
ThePhD
c123fd9204 Fix unused parameter warnings on clang. 2014-08-05 09:22:43 -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