POSIX says, for the extended character classes,
The charclass-name can be used as the property argument to the wctype()
function, in regular expression and shell pattern-matching bracket expressions, and by the tr
command.
and the POSIX regex page, correspondingly, says
In addition, character class expressions of the form:
[:name:]
are recognized in those locales where the name keyword has been given a charclass definition in the LC_CTYPE
category.
So, to reach an extended classification in a narrow-character locale, the only POSIX-compliant way appears to be the POSIX regex class, much like the only way to get to it in C++ is the already-mentioned std::regex_traits::isctype
.
Perhaps you're better off reaching into platform-specific APIs, in terms of which these functions are implemented (where accessible).
PS: Perhaps the more practical approach is to just call btowc
and iswctype
. A locale that classifies a narrow char and its widened form differently is questionable to say the least.