mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:03:03 +01:00
Small optimization - avoid use of std::function<> where not necessary
This commit is contained in:
parent
47a98d6403
commit
0f8e7c185c
@ -32,7 +32,6 @@
|
|||||||
#define CLASSES_AUTO_PTR_H
|
#define CLASSES_AUTO_PTR_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace Firebird {
|
namespace Firebird {
|
||||||
|
|
||||||
@ -318,11 +317,11 @@ private:
|
|||||||
T oldValue;
|
T oldValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename F>
|
||||||
class Cleanup
|
class Cleanup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Cleanup(std::function<void()> clFunc)
|
Cleanup(F&& clFunc)
|
||||||
: clean(clFunc)
|
: clean(clFunc)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -332,7 +331,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::function<void()> clean;
|
F& clean;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace Firebird
|
} //namespace Firebird
|
||||||
|
@ -36,6 +36,8 @@
|
|||||||
#include "../common/MsgMetadata.h"
|
#include "../common/MsgMetadata.h"
|
||||||
#include "../common/classes/ClumpletWriter.h"
|
#include "../common/classes/ClumpletWriter.h"
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Why
|
namespace Why
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user