Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 1.3 KB

is-class-class.md

File metadata and controls

68 lines (50 loc) · 1.3 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: is_class Class
is_class Class
11/04/2016
type_traits/std::is_class
is_class class
is_class
96fc34a3-a81b-4ec6-b7fb-baafde1a0f4e

is_class Class

Tests if type is a class.

Syntax

template <class Ty>
struct is_class;

Parameters

Ty
The type to query.

Remarks

An instance of the type predicate holds true if the type Ty is a type defined as a class or a struct, or a cv-qualified form of one of them, otherwise it holds false.

Example

// std__type_traits__is_class.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>

struct trivial
    {
    int val;
    };

int main()
    {
    std::cout << "is_class<trivial> == " << std::boolalpha
        << std::is_class<trivial>::value << std::endl;
    std::cout << "is_class<int> == " << std::boolalpha
        << std::is_class<int>::value << std::endl;

    return (0);
    }
is_class<trivial> == true
is_class<int> == false

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
is_compound Class
is_union Class