Browse Source

examples: Use new const qualified in examples

Ole 10 years ago
parent
commit
76eb9c0ea7
1 changed files with 2 additions and 2 deletions
  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>}
 		}
 	);