diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-10-11 17:42:11 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-10-11 17:42:46 -0400 |
commit | 1f9a9ef19af95bd8433274e4640f1b8b23f56d46 (patch) | |
tree | 74e552b5a94e18027264ee5aadf7910cadd6a580 /src/vZ/EquationSystem.hpp | |
parent | f123be63a5760782c563d81d7842de6cc3e5646b (diff) | |
download | vz-1f9a9ef19af95bd8433274e4640f1b8b23f56d46.tar.xz |
Fix typo, and disallow 0-sized EquationSystems.
Diffstat (limited to 'src/vZ/EquationSystem.hpp')
-rw-r--r-- | src/vZ/EquationSystem.hpp | 8 |
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> > |