From b042644c85b16a11d8a352168c169f83e3b52af1 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 2 Jun 2002 12:01:35 +0000 Subject: [PATCH] bind() doesn't work on extern "C" functions [SVN r14069] --- src/object/function.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/object/function.cpp b/src/object/function.cpp index f4913fd8..021770b0 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -8,9 +8,7 @@ #include #include #include -#include #include -#include #include namespace boost { namespace python { namespace objects { @@ -113,6 +111,14 @@ namespace "xor__", }; + struct less_cstring + { + bool operator()(char const* x, char const* y) const + { + return BOOST_CSTD_::strcmp(x,y) < 0; + } + }; + inline bool is_binary_operator(char const* name) { return name[0] == '_' @@ -121,8 +127,7 @@ namespace &binary_operator_names[0] , binary_operator_names + sizeof(binary_operator_names)/sizeof(*binary_operator_names) , name + 2 - , bind(std::less(), - bind(BOOST_CSTD_::strcmp, _1, _2), 0) + , less_cstring() ); }