Switch to C++20
This commit is contained in:
@@ -26,7 +26,7 @@ namespace OpenVulkano
|
||||
ComponentDecodeHolder(const std::string_view& versionStr)
|
||||
{
|
||||
if (versionStr.empty()) return;
|
||||
int offset = 0;
|
||||
size_t offset = 0;
|
||||
if (versionStr[0] == 'v' || versionStr[0] == 'V')
|
||||
{
|
||||
offset++;
|
||||
@@ -54,7 +54,7 @@ namespace OpenVulkano
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static void ReadVersionComponents(std::vector<uint32_t>& comps, const std::string_view& versionStr, int& offset)
|
||||
static void ReadVersionComponents(std::vector<uint32_t>& comps, const std::string_view& versionStr, size_t& offset)
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace OpenVulkano
|
||||
} while(versionStr.size() > offset);
|
||||
}
|
||||
|
||||
static void ReadTagComponents(std::vector<std::string>& tags, const std::string_view& versionStr, int& offset)
|
||||
static void ReadTagComponents(std::vector<std::string>& tags, const std::string_view& versionStr, size_t& offset)
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -88,11 +88,11 @@ namespace OpenVulkano
|
||||
}
|
||||
}
|
||||
|
||||
Version::Version(uint32_t major, uint32_t minor, uint32_t patch, uint32_t build)
|
||||
Version::Version(uint32_t major, uint32_t minor, uint32_t patch, const uint32_t build)
|
||||
: m_versionComponents(build ? std::initializer_list<uint32_t>{major, minor, patch, build} : std::initializer_list<uint32_t>{major, minor, patch})
|
||||
, m_buildNumber(build)
|
||||
#if (__cplusplus >= 202002L)
|
||||
, m_versionString(std::format(build ? "v{}.{}.{}.{}" : "v{}.{}.{}", major, minor, patch, build))
|
||||
, m_versionString(std::format("v{}.{}.{}.{}", major, minor, patch, build))
|
||||
#else
|
||||
, m_versionString("v" + std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(patch) + (build ? "." + std::to_string(build) : ""))
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user