소스 검색

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)...);