Moved friends out of each class; class => struct

This commit is contained in:
Bob Polis 2023-08-07 17:19:04 +02:00
parent b80f093c87
commit d6d7e3d4cd
2 changed files with 16 additions and 20 deletions

View File

@ -41,41 +41,38 @@ namespace sc {
std::ostream& whiteb(std::ostream& out); std::ostream& whiteb(std::ostream& out);
std::ostream& defaultb(std::ostream& out); std::ostream& defaultb(std::ostream& out);
class grayf { struct grayf {
int _val; int _val;
public: grayf(int val);
grayf(int val);
friend std::ostream& operator<<(std::ostream& out, const grayf& obj);
}; };
class grayb { struct grayb {
int _val; int _val;
public: grayb(int val);
grayb(int val);
friend std::ostream& operator<<(std::ostream& out, const grayb& obj);
}; };
class rgbf { struct rgbf {
int _r; int _r;
int _g; int _g;
int _b; int _b;
public: rgbf(int r, int g, int b);
rgbf(int r, int g, int b);
friend std::ostream& operator<<(std::ostream& out, const rgbf& obj);
}; };
class rgbb { struct rgbb {
int _r; int _r;
int _g; int _g;
int _b; int _b;
public: rgbb(int r, int g, int b);
rgbb(int r, int g, int b);
friend std::ostream& operator<<(std::ostream& out, const rgbb& obj);
}; };
std::ostream& operator<<(std::ostream& out, const grayf& obj);
std::ostream& operator<<(std::ostream& out, const grayb& obj);
std::ostream& operator<<(std::ostream& out, const rgbf& obj);
std::ostream& operator<<(std::ostream& out, const rgbb& obj);
} }
} }

View File

@ -36,14 +36,13 @@ namespace sc {
namespace io { namespace io {
class clear_line { struct clear_line {
const term& _term; const term& _term;
public: clear_line(const term& t);
clear_line(const term& t);
friend std::ostream& operator<<(std::ostream& out, const clear_line& obj);
}; };
std::ostream& operator<<(std::ostream& out, const clear_line& obj);
} }
} }