Skip to content

Latest commit

 

History

History
73 lines (55 loc) · 1.53 KB

is-signed-class.md

File metadata and controls

73 lines (55 loc) · 1.53 KB
descriptiontitlems.datef1_keywordshelpviewer_keywordsms.assetid
Learn more about: is_signed Class
is_signed Class
11/04/2016
type_traits/std::is_signed
is_signed class
is_signed
20ae44d9-22ad-4fbd-b26a-f18c62689451

is_signed Class

Test if type is signed integer.

Syntax

template <classTy> structis_signed;

Parameters

Ty
The type to query.

Remarks

An instance of the type predicate holds true if the type Ty is a signed integral type or a cv-qualified signed integral type, otherwise it holds false.

Example

// std__type_traits__is_signed.cpp// compile with: /EHsc #include<type_traits> #include<iostream>structtrivial { int val; }; intmain() { std::cout << "is_signed<trivial> == " << std::boolalpha << std::is_signed<trivial>::value << std::endl; std::cout << "is_signed<int> == " << std::boolalpha << std::is_signed<int>::value << std::endl; std::cout << "is_signed<unsigned int> == " << std::boolalpha << std::is_signed<unsignedint>::value << std::endl; std::cout << "is_signed<float> == " << std::boolalpha << std::is_signed<float>::value << std::endl; return (0); }
is_signed<trivial> == false is_signed<int> == true is_signed<unsigned int> == false is_signed<float> == true 

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
is_unsigned Class

close