aboutsummaryrefslogtreecommitdiff
path: root/Gem/develop/include/Gem/Utils/is_pointer.h
blob: 6c5cb168e8df312e9995e7acead941ae2916eaad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright © 2010 fredoverflow https://stackoverflow.com/a/3177723/1169096
 * Copyright © 2019 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at
 */

#ifndef GEM_IS_POINTER_H_
#define GEM_IS_POINTER_H_

namespace gem
{
  template <typename T>
    struct is_pointer_type
    {
      enum { value = false };
    };

  template <typename T>
    struct is_pointer_type<T*>
    {
      enum { value = true };
    };

  template <typename T>
    bool is_pointer(void)
    {
      return is_pointer_type<T>::value;
    }
  template <typename T>
    bool is_pointer(const T&)
    {
      return is_pointer_type<T>::value;
    }
};
#endif // GEM_IS_POITNER_H_