Namespaces
Variants
Views
Actions

std::isdigit(std::locale)

From cppreference.com
< cpp‎ | locale
Revision as of 23:08, 31 May 2013 by P12bot (Talk | contribs)

Defined in header <locale>
template< class charT >
bool isdigit( charT ch, const locale& loc );

Checks if the given character is classified as a digit by the given locale's std::ctype facet.

Contents

Parameters

ch - character
loc - locale

Return value

Returns true if the character is classified as a digit, false otherwise.

Possible implementation

template< class charT >
bool isdigit( charT ch, const std::locale& loc ) {
    return std::use_facet<std::ctype<charT>>(loc).is(std::ctype_base::digit, ch);
}

Example

See also

checks if a character is a digit
(function) [edit]
checks if a wide character is a digit
(function) [edit]