Rename Count to lowercase, make const

This commit is contained in:
King_DuckZ 2021-04-22 13:35:37 +02:00
parent 3124548314
commit 13bd166827
2 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ namespace dhandy {
template <std::size_t N>
class Version {
public:
constexpr static std::size_t Count = N;
constexpr static const std::size_t count = N;
constexpr Version (const char* const ver, bool accept_less=false);

View file

@ -24,7 +24,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
{
constexpr Version<1> ver{"102"};
static_assert(ver.major() == 102, "Version error");
static_assert(ver.Count == 1, "Version error");
static_assert(ver.count == 1, "Version error");
CHECK(ver[0] == 102);
CHECK_THROWS(ver[1]);
CHECK_THROWS(ver[2]);
@ -34,7 +34,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
{
constexpr Version<3> ver{".aheud15,a.ud22,cu.sh81,.nuad.h44"};
static_assert(ver.Count == 3, "Version error");
static_assert(ver.count == 3, "Version error");
static_assert(ver.major() == 15, "Version error");
static_assert(ver.minor() == 22, "Version error");
static_assert(ver.revision() == 81, "Version error");
@ -47,7 +47,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
{
constexpr Version<10> ver{"1.2.3.44.55.66.777.888.999.101010"};
static_assert(ver.Count == 10, "Version error");
static_assert(ver.count == 10, "Version error");
static_assert(ver.major() == 1, "Version error");
static_assert(ver.minor() == 2, "Version error");
static_assert(ver.revision() == 3, "Version error");
@ -66,7 +66,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
{
constexpr Version<4> ver{"1.2.3.", true};
static_assert(ver.Count == 4, "Version error");
static_assert(ver.count == 4, "Version error");
static_assert(ver.major() == 1, "Version error");
static_assert(ver.minor() == 2, "Version error");
static_assert(ver.revision() == 3, "Version error");
@ -79,7 +79,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
{
constexpr Version<4> ver{"6.7.2-r1"};
static_assert(ver.Count == 4, "Version error");
static_assert(ver.count == 4, "Version error");
static_assert(ver.major() == 6, "Version error");
static_assert(ver.minor() == 7, "Version error");
static_assert(ver.revision() == 2, "Version error");