Index: code/trunk/src/libraries/core/input/InputDevice.h
===================================================================
--- code/trunk/src/libraries/core/input/InputDevice.h	(revision 8858)
+++ code/trunk/src/libraries/core/input/InputDevice.h	(revision 11071)
@@ -60,5 +60,5 @@
         //! Only resets the members
         InputDevice(unsigned int id) : bCalibrating_(false), deviceID_(id) { }
-        virtual ~InputDevice() { }
+        virtual ~InputDevice() = default;
         //! Returns the device class (derived) name as string
         virtual std::string getClassName() const = 0;
@@ -99,5 +99,7 @@
 
     private:
-        InputDevice(const InputDevice& rhs); //!< Don't use!
+        // non-copyable:
+        InputDevice(const InputDevice&) = delete;
+        InputDevice& operator=(const InputDevice&) = delete;
 
         bool bCalibrating_;                  //!< Whether the device is in calibration mode
@@ -153,17 +155,17 @@
 
         //! Captures OIS events (which then get distributed to the derived class) and creates the button held events
-        void update(const Clock& time)
+        virtual void update(const Clock& time) override
         {
             oisDevice_->capture();
 
             // Call all the states with the held button event
-            for (unsigned int iB = 0; iB < pressedButtons_.size(); ++iB)
-                for (unsigned int iS = 0; iS < inputStates_.size(); ++iS)
-                    inputStates_[iS]->buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>(
-                        this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(pressedButtons_[iB]));
+            for (ButtonType& button : pressedButtons_)
+                for (InputState* state : inputStates_)
+                    state->template buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>(
+                        this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
 
             // Call states with device update events
-            for (unsigned int i = 0; i < inputStates_.size(); ++i)
-                inputStates_[i]->update(time.getDeltaTime(), this->getDeviceID());
+            for (InputState* state : inputStates_)
+                state->update(time.getDeltaTime(), this->getDeviceID());
 
             static_cast<DeviceClass*>(this)->updateImpl(time);
@@ -171,5 +173,5 @@
 
         //! Clears the list of pressed buttons and calls the derived class's method
-        void clearBuffers()
+        virtual void clearBuffers() override
         {
             pressedButtons_.clear();
@@ -180,5 +182,5 @@
         OISDeviceClass* getOISDevice()   { return this->oisDevice_; }
         // Returns the name of the derived class as string
-        std::string getClassName() const { return DeviceClass::getClassNameImpl(); }
+        virtual std::string getClassName() const override { return DeviceClass::getClassNameImpl(); }
 
     protected:
@@ -196,6 +198,6 @@
 
             // Call states
-            for (unsigned int i = 0; i < inputStates_.size(); ++i)
-                inputStates_[i]->buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
+            for (InputState* state : inputStates_)
+                state->template buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
         }
 
@@ -218,6 +220,6 @@
 
             // Call states
-            for (unsigned int i = 0; i < inputStates_.size(); ++i)
-                inputStates_[i]->buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
+            for (InputState* state : inputStates_)
+                state->template buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
         }
 
