diff --git a/Characteristics.cpp b/Characteristics.cpp index b068d45..2ce8b64 100644 --- a/Characteristics.cpp +++ b/Characteristics.cpp @@ -31,8 +31,7 @@ Characteristics::Characteristics(int a, int b, int c, int d, T t) { tier = t; } -template class Characteristics; -template class Characteristics; + template<> Characteristics::Characteristics(int a, int b, int c, int d) { @@ -51,7 +50,16 @@ Characteristics::Characteristics(int a, int b, int c, int d) { tier = 1; } -std::ostream & operator<<(std::ostream &out, const Characteristics &c) { +template class Characteristics; +template class Characteristics; + +template +std::ostream & operator<< (std::ostream &out, const Characteristics &c) { out << "Tier: " << c.tier << "\n"; return out; -} \ No newline at end of file +} + +template +std::ostream& operator<< <>(std::ostream& o, const Characteristics& x); +template +std::ostream& operator<< <>(std::ostream& o, const Characteristics& x); diff --git a/Characteristics.h b/Characteristics.h index cfbc039..40ddd3a 100644 --- a/Characteristics.h +++ b/Characteristics.h @@ -9,6 +9,12 @@ #include #include "Rating.h" +template +class Characteristics; + +template +std::ostream& operator<<(std::ostream& o, const Characteristics& c); + template class Characteristics { private: @@ -22,7 +28,7 @@ class Characteristics { float getMatching(const Characteristics &c); void updateCharacteristics(const Characteristics &extra, int multiplier); - friend std::ostream & operator << (std::ostream &out, const Characteristics &c); + friend std::ostream& operator<< <>(std::ostream&, const Characteristics&); };