chore: C++ google style
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user