From b17b9021ecf9b16c265d0a6b60faa761b34eae35 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 12 Feb 2013 20:18:58 -0800 Subject: Replace mt_rand with Also add some utility methods and classes. --- src/common/random.t.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/common/random.t.hpp (limited to 'src/common/random.t.hpp') diff --git a/src/common/random.t.hpp b/src/common/random.t.hpp new file mode 100644 index 0000000..98a6c59 --- /dev/null +++ b/src/common/random.t.hpp @@ -0,0 +1,23 @@ +#ifndef RANDOM_T_HPP +#define RANDOM_T_HPP + +namespace random_ +{ + struct Fraction + { + int num, den; + }; + + template + struct Fixed + { + T num; + + operator Fraction() + { + return {num, den}; + } + }; +} // namespace random_ + +#endif // RANDOM_T_HPP -- cgit v1.2.3-60-g2f50