Преглед на файлове

Allow NativeFunction to be called when const qualified

Ole преди 9 години
родител
ревизия
2bbf8fdcb1
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      lib/luwra/functions.hpp

+ 4 - 4
lib/luwra/functions.hpp

@@ -47,7 +47,7 @@ struct NativeFunction: Reference {
 	{}
 
 	inline
-	R operator ()() {
+	R operator ()() const {
 		impl->push();
 
 		lua_call(impl->state, 0, 1);
@@ -58,7 +58,7 @@ struct NativeFunction: Reference {
 	}
 
 	template <typename... A> inline
-	R operator ()(A&&... args) {
+	R operator ()(A&&... args) const {
 		impl->push();
 		size_t numArgs = push(impl->state, std::forward<A>(args)...);
 
@@ -80,13 +80,13 @@ struct NativeFunction<void>: Reference {
 	{}
 
 	inline
-	void operator ()() {
+	void operator ()() const {
 		impl->push();
 		lua_call(impl->state, 0, 0);
 	}
 
 	template <typename... A> inline
-	void operator ()(A&&... args) {
+	void operator ()(A&&... args) const {
 		impl->push();
 		size_t numArgs = push(impl->state, std::forward<A>(args)...);