Factorize a no-op deleter for shared pointer

* include/abg-sptr-utils.h (struct noop_deleter): Move this here
	from ...
	* src/abg-comparison.cc (struct noop_deleter): ... here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2014-09-30 18:04:14 +02:00
parent 56ee6cdcc5
commit 4e44ee383c
2 changed files with 11 additions and 10 deletions

View File

@ -73,6 +73,15 @@ template<>
regex_t_sptr
build_sptr<regex_t>(regex_t *p);
/// A deleter for shared pointers that ... doesn't delete the object
/// managed by the shared pointer.
struct noop_deleter
{
template<typename T>
void
operator()(const T*)
{}
};
}// end namespace sptr_utils
}// end namespace abigail

View File

@ -29,6 +29,7 @@
#include "abg-hash.h"
#include "abg-comparison.h"
#include "abg-comp-filter.h"
#include "abg-sptr-utils.h"
namespace abigail
{
@ -40,16 +41,7 @@ namespace comparison
using std::vector;
using std::tr1::dynamic_pointer_cast;
using std::tr1::static_pointer_cast;
/// A deleter for shared pointers that ... doesn't delete the object
/// managed by the shared pointer.
struct noop_deleter
{
template<typename T>
void
operator()(const T*)
{}
};
using abigail::sptr_utils::noop_deleter;
/// Convenience typedef for a pair of decls.
typedef std::pair<const decl_base_sptr, const decl_base_sptr> decls_type;