[v2,02/21] abg-cxx-compat: more <functional> support: std::bind and friends

Message ID 20200703164651.1510825-3-maennich@google.com
State Superseded
Headers
Series Refactor (k)symtab reader |

Commit Message

Matthias Männich July 3, 2020, 4:46 p.m. UTC
  Add abg_compat::{bind,function,placeholders} to the compatibility layer.
That is made use of in a later patch. As usual, for C++ standards that
natively support this functionality (C++11 and later), the native
implementation is aliased into the abg_compat namespace.

	* include/abg-cxx-compat.h: add support for
	  abg_compat::{bind,function,placeholders}

Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
---
 include/abg-cxx-compat.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Patch

diff --git a/include/abg-cxx-compat.h b/include/abg-cxx-compat.h
index 1283e9191d46..cab2883b231e 100644
--- a/include/abg-cxx-compat.h
+++ b/include/abg-cxx-compat.h
@@ -58,8 +58,15 @@  namespace abg_compat {
 #if __cplusplus >= 201103L
 
 // <functional>
+using std::bind;
+using std::function;
 using std::hash;
 
+namespace placeholders
+{
+using namespace std::placeholders;
+}
+
 // <memory>
 using std::shared_ptr;
 using std::weak_ptr;
@@ -75,8 +82,15 @@  using std::unordered_set;
 #else
 
 // <functional>
+using std::tr1::bind;
+using std::tr1::function;
 using std::tr1::hash;
 
+namespace placeholders
+{
+using namespace std::tr1::placeholders;
+}
+
 // <memory>
 using std::tr1::shared_ptr;
 using std::tr1::weak_ptr;