chore: C++ google style

This commit is contained in:
huanghongxun
2021-05-30 02:42:39 +08:00
parent 258a6628e4
commit 6d75c4d34f
10 changed files with 276 additions and 302 deletions

View File

@@ -2,39 +2,30 @@
#include <string>
class Version
{
public:
int ver[4];
class Version {
public:
int ver[4];
Version(const std::wstring &rawString);
Version(const std::wstring &rawString);
template <typename T>
Version(std::initializer_list<T> ver_list)
{
int i = 0;
for (const auto &data : ver_list)
{
if (i >= 4)
break;
ver[i++] = data;
}
}
template <typename T>
Version(std::initializer_list<T> ver_list) {
int i = 0;
for (const auto &data : ver_list) {
if (i >= 4) break;
ver[i++] = data;
}
}
bool operator<(const Version &other) const
{
for (int i = 0; i < 4; ++i)
if (ver[i] != other.ver[i])
return ver[i] < other.ver[i];
return false;
}
bool operator<(const Version &other) const {
for (int i = 0; i < 4; ++i)
if (ver[i] != other.ver[i]) return ver[i] < other.ver[i];
return false;
}
bool operator<=(const Version &other) const
{
for (int i = 0; i < 4; ++i)
if (ver[i] != other.ver[i])
return ver[i] < other.ver[i];
return true;
}
bool operator<=(const Version &other) const {
for (int i = 0; i < 4; ++i)
if (ver[i] != other.ver[i]) return ver[i] < other.ver[i];
return true;
}
};