From c3619e541564d5133a3ccdaeb79588d37d46a3db Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 16 Jul 2009 01:16:23 +0000 Subject: Make copy() a const method. --- libdimensionxx/objects.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libdimensionxx/objects.cpp') diff --git a/libdimensionxx/objects.cpp b/libdimensionxx/objects.cpp index 7bedd92..fffa3c4 100644 --- a/libdimensionxx/objects.cpp +++ b/libdimensionxx/objects.cpp @@ -33,13 +33,13 @@ namespace Dimension // Shallow copy a sphere Object* - Sphere::copy() + Sphere::copy() const { return new Sphere(*this); } // Protected copy constructor - Sphere::Sphere(Sphere& sphere) + Sphere::Sphere(const Sphere& sphere) : Object(sphere) { } @@ -54,13 +54,13 @@ namespace Dimension // Shallow copy a cube Object* - Cube::copy() + Cube::copy() const { return new Cube(*this); } // Protected copy constructor - Cube::Cube(Cube& sphere) - : Object(sphere) + Cube::Cube(const Cube& cube) + : Object(cube) { } } -- cgit v1.2.3