fixed: move to util namespace

This commit is contained in:
Danny Robson 2014-12-05 13:20:05 +11:00
parent a340473502
commit c2d608410b
2 changed files with 36 additions and 32 deletions

View File

@ -14,13 +14,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with libgim. If not, see <http://www.gnu.org/licenses/>. * along with libgim. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2011 Danny Robson <danny@nerdcruft.net> * Copyright 2011, 2014 Danny Robson <danny@nerdcruft.net>
*/ */
#include "fixed.hpp" #include "fixed.hpp"
#include <cmath> #include <cmath>
using namespace util;
/* /*
* Constructors * Constructors
*/ */

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with libgim. If not, see <http://www.gnu.org/licenses/>. * along with libgim. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2011 Danny Robson <danny@nerdcruft.net> * Copyright 2011, 2014 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_FIXED_HPP #ifndef __UTIL_FIXED_HPP
@ -24,6 +24,7 @@
#include <cstdint> #include <cstdint>
namespace util {
template <unsigned int INT, unsigned int FRAC> template <unsigned int INT, unsigned int FRAC>
class fixed { class fixed {
public: public:
@ -61,5 +62,6 @@ class fixed {
fixed<INT, FRAC> operator *(integral_type) const; fixed<INT, FRAC> operator *(integral_type) const;
fixed<INT, FRAC> operator /(integral_type) const; fixed<INT, FRAC> operator /(integral_type) const;
}; };
}
#endif // __UTIL_FIXED_HPP #endif // __UTIL_FIXED_HPP