summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-11 17:42:11 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-11 17:42:46 -0400
commit1f9a9ef19af95bd8433274e4640f1b8b23f56d46 (patch)
tree74e552b5a94e18027264ee5aadf7910cadd6a580
parentf123be63a5760782c563d81d7842de6cc3e5646b (diff)
downloadvz-1f9a9ef19af95bd8433274e4640f1b8b23f56d46.tar.xz
Fix typo, and disallow 0-sized EquationSystems.
-rw-r--r--src/vZ/EquationSystem.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vZ/EquationSystem.hpp b/src/vZ/EquationSystem.hpp
index 6409f18..790676c 100644
--- a/src/vZ/EquationSystem.hpp
+++ b/src/vZ/EquationSystem.hpp
@@ -37,8 +37,8 @@ namespace vZ
// EquationSystem();
// ~EquationSystem();
- T& operator[](std::size_t i) { return m_values[0]; }
- const T& operator[](std::size_t i) const { return m_values[0]; }
+ T& operator[](std::size_t i) { return m_values[i]; }
+ const T& operator[](std::size_t i) const { return m_values[i]; }
EquationSystem& operator+=(const EquationSystem& rhs);
EquationSystem& operator-=(const EquationSystem& rhs);
@@ -49,6 +49,10 @@ namespace vZ
T m_values[N];
};
+ // Disallow 0-sized EquationSystems
+ template <typename T>
+ class EquationSystem<0, T>;
+
// Traits specialization
template <std::size_t N, typename T>
class Traits<EquationSystem<N, T> >