CARVIEW |
Select Language
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 30 Jul 2025 20:29:31 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Location: /reference/locale/ctype/scan_is/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 30 Jul 2025 20:29:31 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
ETag: W/"9c0a-BAeXKs5Eym1BzY/4Arw3f6bZFpg"
Content-Encoding: gzip
Returns the first character in the range
In ctype's generic template, this function simply calls the virtual protected member do_scan_is, which does the above by default.
In the
Member type char_type is the facet's character type (defined as an alias of ctype's template parameter, charT).
Output:
Reference
C library:
- <cassert> (assert.h)
- <cctype> (ctype.h)
- <cerrno> (errno.h)
-
<cfenv> (fenv.h)C++11
- <cfloat> (float.h)
-
<cinttypes> (inttypes.h)C++11
- <ciso646> (iso646.h)
- <climits> (limits.h)
- <clocale> (locale.h)
- <cmath> (math.h)
- <csetjmp> (setjmp.h)
- <csignal> (signal.h)
- <cstdarg> (stdarg.h)
-
<cstdbool> (stdbool.h)C++11
- <cstddef> (stddef.h)
-
<cstdint> (stdint.h)C++11
- <cstdio> (stdio.h)
- <cstdlib> (stdlib.h)
- <cstring> (string.h)
-
<ctgmath> (tgmath.h)C++11
- <ctime> (time.h)
-
<cuchar> (uchar.h)C++11
- <cwchar> (wchar.h)
- <cwctype> (wctype.h)
Containers:
-
<array>C++11
- <deque>
-
<forward_list>C++11
- <list>
- <map>
- <queue>
- <set>
- <stack>
-
<unordered_map>C++11
-
<unordered_set>C++11
- <vector>
-
Input/Output:
Multi-threading:
-
<atomic>C++11
-
<condition_variable>C++11
-
<future>C++11
-
<mutex>C++11
-
<thread>C++11
-
Other:
- <algorithm>
- <bitset>
-
<chrono>C++11
-
<codecvt>C++11
- <complex>
- <exception>
- <functional>
-
<initializer_list>C++11
- <iterator>
- <limits>
- <locale>
- <memory>
- <new>
- <numeric>
-
<random>C++11
-
<ratio>C++11
-
<regex>C++11
- <stdexcept>
- <string>
-
<system_error>C++11
-
<tuple>C++11
-
<type_traits>C++11
-
<typeindex>C++11
- <typeinfo>
- <utility>
- <valarray>
<locale>
- has_facet
- locale
- use_facet
-
wbuffer_convertC++11
-
wstring_convertC++11
functions
standard facets
ctype
- ctype::ctype
public member functions
ctype<char> specialization
protected members
public member function
<locale>
std::ctype::scan_is
const char_type* scan_is (mask m, const char_type* low, const char_type* high) const;
Return first character in category
[low,high)
that classifies into any of the categories specified in m. If no such character is found in the range, high is returned.In ctype's generic template, this function simply calls the virtual protected member do_scan_is, which does the above by default.
In the
char
specialization (ctype<char>
), this function uses the internal table to directly return the results without calling any virtual member.Parameters
- m
- Bitmask of member type mask (inherited from ctype_base) specifying the categories to scan for. If the bitmask combines more than one category, the function returns a pointer to the first character that belongs to any of the categories.
It may be any bitwise combination of the following member bitmask values:
member constant value description space unspecified (unique bits) white-space character print unspecified (unique bits) printable character cntrl unspecified (unique bits) control character upper unspecified (unique bits) uppercase letter lower unspecified (unique bits) lowercase letter alpha unspecified (unique bits) alphabetic character digit unspecified (unique bits) decimal digit punct unspecified (unique bits) punctuation character xdigit unspecified (unique bits) hexadecimal digit alnum alpha|digit
alpha-numeric character graph alnum|punct
character with graphic representation member constant value description space unspecified (unique bits) white-space character print unspecified (unique bits) printable character cntrl unspecified (unique bits) control character upper unspecified (unique bits) uppercase letter lower unspecified (unique bits) lowercase letter alpha unspecified (unique bits) alphabetic character digit unspecified (unique bits) decimal digit punct unspecified (unique bits) punctuation character xdigit unspecified (unique bits) hexadecimal digit blank unspecified (unique bits) blank character alnum alpha|digit
alpha-numeric character graph alnum|punct
character with graphic representation
- low, high
- Pointer to the beginning and end of the sequence of characters. The range used is
[low,high)
, which contains all the characters between low and high, including the character pointed by low but not the character pointed by high.
Note that null characters (if any) are also considered, and the function proceeds beyond them, until a match is found or the entire range is completed.
Member type char_type is the facet's character type (defined as an alias of ctype's template parameter, charT).
Return value
A pointer to the first element in the range that classifies, or high if none is found.Member type char_type is the facet's character type (defined as an alias of ctype's template parameter, charT).
Example
|
|
Output:
The second sentence is: . Opinions alter, but characters are only developed. |
Data races
The object, and the elements in the range[low,high)
, are accessed.Exception safety
Strong guarantee: if an exception is thrown, there are no changes in the object.See also
- ctype::is
- Classify characters (public member function)
- ctype::scan_not
- Return first character not in category (public member function)
- ctype::do_scan_is
- Return first character in category [virtual] (protected virtual member function)
Home page | Privacy policy
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us