GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • TUTORIALS
  • REFERENCE
  • ARTICLES
  • FORUM
  • C library:
  • <cassert> (assert.h)
  • <cctype> (ctype.h)
  • <cerrno> (errno.h)
  • <cfenv> (fenv.h)
  • <cfloat> (float.h)
  • <cinttypes> (inttypes.h)
  • <ciso646> (iso646.h)
  • <climits> (limits.h)
  • <clocale> (locale.h)

This view

  • Original page
  • New address

GeezerVison is showing cplusplus.com — std::is_pointer

  • TUTORIALS
  • REFERENCE
  • ARTICLES
  • FORUM

C++

  • Tutorials
  • Reference
  • Articles
  • Forum

Reference

  • C library:

    • <cassert> (assert.h)
    • <cctype> (ctype.h)
    • <cerrno> (errno.h)
    • C++11
      <cfenv> (fenv.h)
    • <cfloat> (float.h)
    • C++11
      <cinttypes> (inttypes.h)
    • <ciso646> (iso646.h)
    • <climits> (limits.h)
    • <clocale> (locale.h)
    • <cmath> (math.h)
    • <csetjmp> (setjmp.h)
    • <csignal> (signal.h)
    • <cstdarg> (stdarg.h)
    • C++11
      <cstdbool> (stdbool.h)
    • <cstddef> (stddef.h)
    • C++11
      <cstdint> (stdint.h)
    • <cstdio> (stdio.h)
    • <cstdlib> (stdlib.h)
    • <cstring> (string.h)
    • C++11
      <ctgmath> (tgmath.h)
    • <ctime> (time.h)
    • C++11
      <cuchar> (uchar.h)
    • <cwchar> (wchar.h)
    • <cwctype> (wctype.h)
  • Containers:

    • C++11
      <array>
    • <deque>
    • C++11
      <forward_list>
    • <list>
    • <map>
    • <queue>
    • <set>
    • <stack>
    • C++11
      <unordered_map>
    • C++11
      <unordered_set>
    • <vector>
  • Input/Output:

    • <fstream>
    • <iomanip>
    • <ios>
    • <iosfwd>
    • <iostream>
    • <istream>
    • <ostream>
    • <sstream>
    • <streambuf>
  • Multi-threading:

    • C++11
      <atomic>
    • C++11
      <condition_variable>
    • C++11
      <future>
    • C++11
      <mutex>
    • C++11
      <thread>
  • Other:

    • <algorithm>
    • <bitset>
    • C++11
      <chrono>
    • C++11
      <codecvt>
    • <complex>
    • <exception>
    • <functional>
    • C++11
      <initializer_list>
    • <iterator>
    • <limits>
    • <locale>
    • <memory>
    • <new>
    • <numeric>
    • C++11
      <random>
    • C++11
      <ratio>
    • C++11
      <regex>
    • <stdexcept>
    • <string>
    • C++11
      <system_error>
    • C++11
      <tuple>
    • C++11
      <type_traits>
    • C++11
      <typeindex>
    • <typeinfo>
    • <utility>
    • <valarray>

<type_traits>

  • helper classes

    • C++11
      false_type
    • C++11
      integral_constant
    • C++11
      true_type
  • type traits

    • C++11
      alignment_of
    • C++11
      extent
    • C++11
      has_virtual_destructor
    • C++11
      is_abstract
    • C++11
      is_arithmetic
    • C++11
      is_array
    • C++11
      is_assignable
    • C++11
      is_base_of
    • C++11
      is_class
    • C++11
      is_compound
    • C++11
      is_const
    • C++11
      is_constructible
    • C++11
      is_convertible
    • C++11
      is_copy_assignable
    • C++11
      is_copy_constructible
    • C++11
      is_default_constructible
    • C++11
      is_destructible
    • C++11
      is_empty
    • C++11
      is_enum
    • C++11
      is_floating_point
    • C++11
      is_function
    • C++11
      is_fundamental
    • C++11
      is_integral
    • C++11
      is_literal_type
    • C++11
      is_lvalue_reference
    • C++11
      is_member_function_pointer
    • C++11
      is_member_object_pointer
    • C++11
      is_member_pointer
    • C++11
      is_move_assignable
    • C++11
      is_move_constructible
    • C++11
      is_nothrow_assignable
    • C++11
      is_nothrow_constructible
    • C++11
      is_nothrow_copy_assignable
    • C++11
      is_nothrow_copy_constructible
    • C++11
      is_nothrow_default_constructible
    • C++11
      is_nothrow_destructible
    • C++11
      is_nothrow_move_assignable
    • C++11
      is_nothrow_move_constructible
    • C++14
      is_null_pointer
    • C++11
      is_object
    • C++11
      is_pod
    • C++11
      is_pointer
    • C++11
      is_polymorphic
    • C++11
      is_reference
    • C++11
      is_rvalue_reference
    • C++11
      is_same
    • C++11
      is_scalar
    • C++11
      is_signed
    • C++11
      is_standard_layout
    • C++11
      is_trivial
    • C++11
      is_trivially_assignable
    • C++11
      is_trivially_constructible
    • C++11
      is_trivially_copy_assignable
    • C++11
      is_trivially_copy_constructible
    • C++11
      is_trivially_copyable
    • C++11
      is_trivially_default_constructible
    • C++11
      is_trivially_destructible
    • C++11
      is_trivially_move_assignable
    • C++11
      is_trivially_move_constructible
    • C++11
      is_union
    • C++11
      is_unsigned
    • C++11
      is_void
    • C++11
      is_volatile
    • C++11
      rank
  • type transformations

    • C++11
      add_const
    • C++11
      add_cv
    • C++11
      add_lvalue_reference
    • C++11
      add_pointer
    • C++11
      add_rvalue_reference
    • C++11
      add_volatile
    • C++11
      aligned_storage
    • C++11
      aligned_union
    • C++11
      common_type
    • C++11
      conditional
    • C++11
      decay
    • C++11
      enable_if
    • C++11
      make_signed
    • C++11
      make_unsigned
    • C++11
      remove_all_extents
    • C++11
      remove_const
    • C++11
      remove_cv
    • C++11
      remove_extent
    • C++11
      remove_pointer
    • C++11
      remove_reference
    • C++11
      remove_volatile
    • C++11
      result_of
    • C++11
      underlying_type
  • Reference
  • <type_traits>
  • is_pointer
class template
<type_traits>

std::is_pointer

template <class T> struct is_pointer;
Is pointer
  • integral_constant
  • is_pointer

Trait class that identifies whether T is a pointer type.

It inherits from integral_constant as being either true_type or false_type.

Pointer to functions are considered pointer types by this class, but pointers to non-static class members and the type of nullptr are not (see is_member_object_pointer and is_member_function_pointer).

Template parameters

T
A type.

Member types

Inherited from integral_constant:
member typedefinition
value_typebool
typeeither true_type or false_type

Member constants

Inherited from integral_constant:
member constantdefinition
valueeither true or false

Member functions

Inherited from integral_constant:
operator bool
Returns value (public member function)

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
// is_pointer example
#include <iostream>
#include <type_traits>

int main() {
  std::cout << std::boolalpha;
  std::cout << "is_pointer:" << std::endl;
  std::cout << "int: " << std::is_pointer<int>::value << std::endl;
  std::cout << "int*: " << std::is_pointer<int*>::value << std::endl;
  std::cout << "int**: " << std::is_pointer<int**>::value << std::endl;
  std::cout << "int(*)(int): " << std::is_pointer<int(*)(int)>::value << std::endl;
  return 0;
}

Output:
is_pointer:
int: false
int*: true
int**: true
int(*)(int): true


See also

is_lvalue_reference
Is lvalue reference (class template)
is_rvalue_reference
Is rvalue reference (class template)
is_member_object_pointer
Is member object pointer (class template)
is_member_function_pointer
Is member function pointer (class template)
is_member_pointer
Is member pointer type (class template)
is_function
Is function (class template)
Home page | Privacy policy
© cplusplus.com, 2000-2026 - All rights reserved - v3.3.4s
Spotted an error? contact us
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.