diff --git a/colour.cpp b/colour.cpp index c871fb23..46ff2e28 100644 --- a/colour.cpp +++ b/colour.cpp @@ -35,7 +35,7 @@ colour::operator*= (double v) { const json::node& -operator>> (const json::node &node, colour &c) { +util::operator>> (const json::node &node, colour &c) { c.red = node[0].as_number (); c.green = node[1].as_number (); c.blue = node[2].as_number (); @@ -68,7 +68,7 @@ namespace util { std::ostream& -operator<< (std::ostream &os, const util::colour &c) { +util::operator<< (std::ostream &os, const util::colour &c) { os << "colour(" << c.red << ", " << c.green << ", " << c.blue << ", " << c.alpha << ")"; return os; } diff --git a/colour.hpp b/colour.hpp index a2d055aa..227a1174 100644 --- a/colour.hpp +++ b/colour.hpp @@ -37,9 +37,10 @@ namespace util { template <> colour& randomise (colour&); template <> colour& random (void); + + std::ostream& operator<< (std::ostream&, const util::colour&); + const json::node& operator>> (const json::node&, util::colour&); } -std::ostream& operator<< (std::ostream&, const util::colour&); -const json::node& operator>> (const json::node&, util::colour&); #endif diff --git a/json/validate.cpp b/json/validate.cpp index e383ce29..d0d19616 100644 --- a/json/validate.cpp +++ b/json/validate.cpp @@ -25,7 +25,7 @@ main (int argc, char ** argv) { try { json::parse (boost::filesystem::path (argv[ARG_PATH])); } catch (json::error &x) { - std::cerr << x.what () << std::endl; + std::cerr << "Error: " << x.what () << std::endl; return EXIT_FAILURE; } diff --git a/vector.cpp b/vector.cpp index f7223e14..de9bbc1b 100644 --- a/vector.cpp +++ b/vector.cpp @@ -193,19 +193,19 @@ vector::sanity (void) const { util::vector -operator* (double a, const util::vector &b) +util::operator* (double a, const util::vector &b) { return b * a; } std::ostream& -operator<< (std::ostream &os, const util::vector &v) { +util::operator<< (std::ostream &os, const util::vector &v) { os << "vec(" << v.x << ", " << v.y << ", " << v.z << ")"; return os; } const json::node& -operator>> (const json::node &node, util::vector &v) { +util::operator>> (const json::node &node, util::vector &v) { v.x = node[0].as_number (); v.y = node[1].as_number (); v.z = node[2].as_number (); diff --git a/vector.hpp b/vector.hpp index 0f2cbf32..26cbdd69 100644 --- a/vector.hpp +++ b/vector.hpp @@ -58,11 +58,14 @@ namespace util { void sanity (void) const; }; + + util::vector operator* (double, const util::vector&); + + std::ostream& operator<< (std::ostream&, const util::vector&); + const json::node& operator>> (const json::node&, util::vector&); + } -util::vector operator* (double, const util::vector&); -std::ostream& operator<< (std::ostream&, const util::vector&); -const json::node& operator>> (const json::node&, util::vector&); #endif