- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
const char _LETTERS[] =
"000000000000000000000000000000000000000000000000000000000000000001111111111<...>";
const char _DIGITS[] =
"000000000000000000000000000000000000000000000000111111111100000000000000000<...>";
const char _CONTROL_CHARS[] =
"111111111111111111111111111111110000000000000000000000000000000000000000000<...>";
const char _PUNCT_CHARS[] =
"000000000000000000000000000000000111011111101111000000000011000110000000000<...>";
const char _SEP_CHARS[] =
"000000000000000000000000000000001000000000000000000000000000000000000000000<...>";
const char _SYM_CHARS[] =
"000000000000000000000000000000000000100000010000000000000000111000000000000<...>";
#define min(i,l,I) (((i) < (l)) ? (((i) < (I)) ? (i) : (I)) : (((l) < (I)) ? (l) : (I)))
bool CharIsLetter(wchar_t c) {
return _LETTERS[c] != L'0';
}
bool CharIsDigit(wchar_t c) {
return _DIGITS[c] != L'0';
}
bool CharIsControl(wchar_t c) {
return _CONTROL_CHARS[c] != L'0';
}
bool CharIsPunctuation(wchar_t c) {
return _PUNCT_CHARS[c] != L'0';
}
bool CharIsSeparator(wchar_t c) {
return _SEP_CHARS[c] != L'0';
}
bool CharIsSymbol(wchar_t c) {
return _SYM_CHARS[c] != L'0';
}
groser 25.12.2015 11:07 # +3
gost 25.12.2015 11:09 # 0
bormand 25.12.2015 21:32 # +3
Ок, с base plane разобрались. Осталось ещё 16.
roman-kashitsyn 25.12.2015 11:20 # +5
P.S. Начинать в C++ идентификатор с подчёркивания и большой буквы - UB. Ну а так-то, конечно, надо показать мученику заголовки <locale> и <algorithm>.
3_dar 25.12.2015 18:20 # 0
О_о нихера себе
А из-за чего так?
imihajlov 25.12.2015 18:25 # −2
roman-kashitsyn 25.12.2015 18:30 # +5
Кто ж с таким шутит.
Certain sets of names and function signatures are always reserved to the implementation:
Each name that contains a double underscore (_ _) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implementation for any use.
...
If the program declares or defines an identifier in a context in which it is reserved (other than as allowed by 7.1.4), or defines a reserved identifier as a macro name, the behavior is undefined.
-- http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier
bormand 25.12.2015 20:52 # 0
А _name разве не считаются зарезервированными?
bormand 25.12.2015 20:57 # +3
Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.
Т.е. _name нельзя юзать только в глобальном неймспейсе, а _Name и __name - вообще нигде и никогда.
Soul_re@ver 25.12.2015 21:31 # 0
bormand 25.12.2015 21:34 # 0
roman-kashitsyn 26.12.2015 10:52 # +2
А вдруг разработчики BEM доберутся и до C++?
4e1 25.12.2015 12:46 # 0
groser 30.05.2021 20:48 # 0