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& defaultb(std::ostream& out);
class grayf {
struct grayf {
int _val;
public:
grayf(int val);
friend std::ostream& operator<<(std::ostream& out, const grayf& obj);
grayf(int val);
};
class grayb {
struct grayb {
int _val;
public:
grayb(int val);
friend std::ostream& operator<<(std::ostream& out, const grayb& obj);
grayb(int val);
};
class rgbf {
struct rgbf {
int _r;
int _g;
int _b;
public:
rgbf(int r, int g, int b);
friend std::ostream& operator<<(std::ostream& out, const rgbf& obj);
rgbf(int r, int g, int b);
};
class rgbb {
struct rgbb {
int _r;
int _g;
int _b;
public:
rgbb(int r, int g, int b);
friend std::ostream& operator<<(std::ostream& out, const rgbb& obj);
rgbb(int r, int g, int b);
};
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 {
class clear_line {
struct clear_line {
const term& _term;
public:
clear_line(const term& t);
friend std::ostream& operator<<(std::ostream& out, const clear_line& obj);
clear_line(const term& t);
};
std::ostream& operator<<(std::ostream& out, const clear_line& obj);
}
}