Nugget
function_help.h
1 // Copyright (c) Electronic Arts Inc. All rights reserved.
4 
5 #ifndef EASTL_INTERNAL_FUNCTION_HELP_H
6 #define EASTL_INTERNAL_FUNCTION_HELP_H
7 
8 #if defined(EA_PRAGMA_ONCE_SUPPORTED)
9  #pragma once
10 #endif
11 
12 #include <EASTL/internal/config.h>
13 #include <EASTL/type_traits.h>
14 
15 namespace eastl
16 {
17  namespace internal
18  {
19 
21  // is_null
22  //
23  template <typename T>
24  bool is_null(const T&)
25  {
26  return false;
27  }
28 
29  template <typename Result, typename... Arguments>
30  bool is_null(Result (*const& function_pointer)(Arguments...))
31  {
32  return function_pointer == nullptr;
33  }
34 
35  template <typename Result, typename Class, typename... Arguments>
36  bool is_null(Result (Class::*const& function_pointer)(Arguments...))
37  {
38  return function_pointer == nullptr;
39  }
40 
41  template <typename Result, typename Class, typename... Arguments>
42  bool is_null(Result (Class::*const& function_pointer)(Arguments...) const)
43  {
44  return function_pointer == nullptr;
45  }
46 
47  } // namespace internal
48 } // namespace eastl
49 
50 #endif // Header include guard
51 
Definition: TestTypeTraits.cpp:60
EA Standard Template Library.
Definition: algorithm.h:288