summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-09-12 22:56:52 +0000
committerEnrico Granata <egranata@apple.com>2014-09-12 22:56:52 +0000
commit7506dc06f4c57cdd99d11a6f76f76ed9e4227e4f (patch)
tree861971bad42353d334f3f8aa430401583064f0c4
parent7206c6d11fa4cb5fd44aa680106cb37ce85d9e3b (diff)
downloadbcm5719-llvm-7506dc06f4c57cdd99d11a6f76f76ed9e4227e4f.tar.gz
bcm5719-llvm-7506dc06f4c57cdd99d11a6f76f76ed9e4227e4f.zip
std::function is a better choice than a raw function pointer here. You probably still want to be careful about cleaning up stuff you captured, but it's not like a function pointer wasn't going to let you shoot yourself in the foot given enough dedication.
llvm-svn: 217718
-rw-r--r--lldb/include/lldb/Utility/CleanUp.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/include/lldb/Utility/CleanUp.h b/lldb/include/lldb/Utility/CleanUp.h
index 9dd3ca5fe12..9ffe5de27df 100644
--- a/lldb/include/lldb/Utility/CleanUp.h
+++ b/lldb/include/lldb/Utility/CleanUp.h
@@ -11,6 +11,7 @@
#define liblldb_CleanUp_h_
#include "lldb/lldb-public.h"
+#include <functional>
namespace lldb_utility {
@@ -57,7 +58,7 @@ class CleanUp
{
public:
typedef T value_type;
- typedef R (*CallbackType)(value_type);
+ typedef std::function<R(value_type)> CallbackType;
//----------------------------------------------------------------------
// Constructor that sets the current value only. No values are
@@ -188,7 +189,7 @@ class CleanUp2
{
public:
typedef T value_type;
- typedef R (*CallbackType)(value_type, A0);
+ typedef std::function<R(value_type,A0)> CallbackType;
//----------------------------------------------------------------------
// Constructor that sets the current value only. No values are
OpenPOWER on IntegriCloud