mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: replace std::size() replacement by real deal
At other places, we already used std::size(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fdffb870e5
commit
afa989e32c
1 changed files with 3 additions and 10 deletions
|
@ -104,26 +104,19 @@ static const char *negate_description[2] {
|
||||||
QT_TRANSLATE_NOOP("gettextFromC", "is not"),
|
QT_TRANSLATE_NOOP("gettextFromC", "is not"),
|
||||||
};
|
};
|
||||||
|
|
||||||
// std::size() is only available starting in C++17, so let's roll our own.
|
|
||||||
template <typename T, size_t N>
|
|
||||||
static constexpr size_t array_size(const T (&)[N])
|
|
||||||
{
|
|
||||||
return N;
|
|
||||||
}
|
|
||||||
|
|
||||||
static constexpr size_t type_descriptions_count()
|
static constexpr size_t type_descriptions_count()
|
||||||
{
|
{
|
||||||
return array_size(type_descriptions);
|
return std::size(type_descriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr size_t string_mode_descriptions_count()
|
static constexpr size_t string_mode_descriptions_count()
|
||||||
{
|
{
|
||||||
return array_size(string_mode_descriptions);
|
return std::size(string_mode_descriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr size_t range_mode_descriptions_count()
|
static constexpr size_t range_mode_descriptions_count()
|
||||||
{
|
{
|
||||||
return array_size(range_mode_descriptions);
|
return std::size(range_mode_descriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const type_description *get_type_description(enum filter_constraint_type type)
|
static const type_description *get_type_description(enum filter_constraint_type type)
|
||||||
|
|
Loading…
Add table
Reference in a new issue