Browse Source

Initial commit

Samuel Jaffe 9 years ago
commit
e92a536963

+ 64 - 0
bound_number.hpp

@@ -0,0 +1,64 @@
+//
+//  bound_number.hpp
+//  utilities
+//
+//  Created by Sam Jaffe on 10/22/13.
+//  Copyright (c) 2013 Sam Jaffe. All rights reserved.
+//
+
+#pragma once
+
+template <class Tp, Tp MINIMUM_VALUE, Tp MAXIMUM_VALUE>
+class bound_number final {
+private:
+public:
+    typedef Tp value_type;
+    
+    bound_number() = default;
+    bound_number(const bound_number& other) = default;
+    bound_number(bound_number&& other) = default;
+    bound_number& operator=(const bound_number& other) = default;
+    bound_number& operator=(bound_number&& other) = default;
+    ~bound_number() = default;
+
+    bound_number(const Tp value) :
+    value(value) {
+        
+    }
+    
+    bound_number& operator --() {
+        if (value > MINIMUM_VALUE) {
+            --value;
+        }
+        return *this;
+    }
+    
+    bound_number& operator ++() {
+        if (value < MAXIMUM_VALUE) {
+            ++value;
+        }
+        return *this;
+    }
+    
+    bound_number operator --(int) {
+        bound_number tmp = *this;
+        if (value > MINIMUM_VALUE) {
+            --value;
+        }
+        return tmp;
+    }
+    
+    bound_number operator ++(int) {
+        bound_number tmp = *this;
+        if (value < MAXIMUM_VALUE) {
+            ++value;
+        }
+        return tmp;
+    }
+    
+    operator Tp() const {
+        return value;
+    }
+private:
+    Tp value;
+};

+ 145 - 0
limit.xcodeproj/project.pbxproj

@@ -0,0 +1,145 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXFileReference section */
+		0E5DFDCB1BB4D3360063976E /* bound_number.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = bound_number.hpp; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXGroup section */
+		0E5DFDC51BB4D3360063976E = {
+			isa = PBXGroup;
+			children = (
+				0E5DFDCB1BB4D3360063976E /* bound_number.hpp */,
+				0E5DFE1C1BB4DB740063976E /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		0E5DFE1C1BB4DB740063976E /* Products */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXLegacyTarget section */
+		0E5DFDCA1BB4D3360063976E /* limit */ = {
+			isa = PBXLegacyTarget;
+			buildArgumentsString = "$(ACTION)";
+			buildConfigurationList = 0E5DFDCD1BB4D3360063976E /* Build configuration list for PBXLegacyTarget "limit" */;
+			buildPhases = (
+			);
+			buildToolPath = /usr/bin/make;
+			buildWorkingDirectory = "/Users/leumasjaffe/Documents/Programming/XTools Workspace/C:C++/misc/math/limit";
+			dependencies = (
+			);
+			name = limit;
+			passBuildSettingsInEnvironment = 1;
+			productName = limit;
+		};
+/* End PBXLegacyTarget section */
+
+/* Begin PBXProject section */
+		0E5DFDC61BB4D3360063976E /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0720;
+			};
+			buildConfigurationList = 0E5DFDC91BB4D3360063976E /* Build configuration list for PBXProject "limit" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = 0E5DFDC51BB4D3360063976E;
+			productRefGroup = 0E5DFE1C1BB4DB740063976E /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				0E5DFDCA1BB4D3360063976E /* limit */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin XCBuildConfiguration section */
+		0E5DFDC71BB4D3360063976E /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				ENABLE_TESTABILITY = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = macosx;
+			};
+			name = Debug;
+		};
+		0E5DFDC81BB4D3360063976E /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				SDKROOT = macosx;
+			};
+			name = Release;
+		};
+		0E5DFDCE1BB4D3360063976E /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				DEBUGGING_SYMBOLS = YES;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				PRODUCT_NAME = limit;
+			};
+			name = Debug;
+		};
+		0E5DFDCF1BB4D3360063976E /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				PRODUCT_NAME = limit;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		0E5DFDC91BB4D3360063976E /* Build configuration list for PBXProject "limit" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				0E5DFDC71BB4D3360063976E /* Debug */,
+				0E5DFDC81BB4D3360063976E /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		0E5DFDCD1BB4D3360063976E /* Build configuration list for PBXLegacyTarget "limit" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				0E5DFDCE1BB4D3360063976E /* Debug */,
+				0E5DFDCF1BB4D3360063976E /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 0E5DFDC61BB4D3360063976E /* Project object */;
+}

+ 7 - 0
limit.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>