소스 검색

examples: Use new const qualified in examples

Ole 10 년 전
부모
커밋
76eb9c0ea7
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      examples/usertypes.cpp

+ 2 - 2
examples/usertypes.cpp

@@ -21,7 +21,7 @@ struct Point {
 		y *= f;
 	}
 
-	std::string toString() {
+	std::string toString() const {
 		return "<Point(" + std::to_string(x) + ", " + std::to_string(y) + ")>";
 	}
 };
@@ -43,7 +43,7 @@ int main() {
 		},
 		// Meta methods may be registered aswell
 		{
-			{"__tostring", luwra::wrap_method<Point, std::string(), &Point::toString>}
+			{"__tostring", luwra::wrap_method<const Point, std::string(), &Point::toString>}
 		}
 	);