Skip to content

Commit

Permalink
Improve character comparisons.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaxyM authored Aug 21, 2024
1 parent 069d95c commit 7abc2a9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions include/crap/locale.d/isuppervalue.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#ifndef CRAP_LOCALE_ISUPPERVALUE
#define CRAP_LOCALE_ISUPPERVALUE

#include "locale.h"

#include <cstdint>
#include <type_traits>

#include "locale.h"
#include "../utility.d/cmpgreaterequalvalue.h"
#include "../utility.d/cmplessequalvalue.h"

namespace crap
{
template <class CharType, CharType, locale = locale :: C> struct isupperValue;

template <class CharType, CharType Char> struct isupperValue<CharType, Char, locale :: C>
: std :: integral_constant<bool, (Char >= static_cast<CharType>(65)) && (Char <= static_cast<CharType>(90))>
: std :: integral_constant<bool, (cmpGreaterEqualValue <CharType, Char, std :: uint32_t, UINT32_C(65)> :: value)
&& (cmpLessEqualValue <CharType, Char, std :: uint32_t, UINT32_C(90)> :: value)>
{};
}
#endif
Expand Down

0 comments on commit 7abc2a9

Please sign in to comment.