std::ctype::is, std::ctype::do_is - cppreference.com (original) (raw)

| Defined in header | | | | --------------------------------------------------------------------------------------------------- | --- | | | public: bool is( mask m, CharT c ) const; | (1) | | | public: const CharT* is( const CharT* low, const CharT* high, mask* vec ) const; | (2) | | | protected: virtual bool do_is( mask m, CharT c ) const; | (3) | | | protected: virtual const CharT* do_is( const CharT* low, const CharT* high, mask* vec ) const; | (4) | |

1,2) Public member function, calls the protected virtual member function do_is of the most derived class.

  1. Checks if the character c is classified by the mask m.

  2. For every character in the character array [low, high), identifies the complete classification mask (e.g. digit|xdigit|alnum|print|graph for the digit '0' in the default locale), and stores the masks in the corresponding elements of the array pointed to by vec.

[edit] Parameters

c - character to classify
m - mask to use for classifying a single character
low - pointer to the first character in an array of characters to classify
high - one past the end pointer for the array of characters to classify
vec - pointer to the first element of the array of masks to fill

[edit] Return value

1,3) true if c is classified by m.

2,4) high

[edit] Example

Output:

'0' is a digit U+7a is: alnum U+df is: alnum U+6c34 is: alnum U+1d10b is: punct

[edit] See also

| | classifies a character or a character sequence, using the classification table (public member function of std::ctype) [edit] | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | | classifies a wide character according to the specified LC_CTYPE category (function) [edit] |