blueloveTH 1 yıl önce
ebeveyn
işleme
597abacc58

+ 0 - 7
docs/bindings.md

@@ -92,13 +92,6 @@ vm->bind(obj, "f() -> int", [](VM* vm, ArgsView args){
 }, x);  // capture x
 ```
 
-The 3rd way is to change the macro `PK_ENABLE_STD_FUNCTION` in `config.h`:
-```cpp
-#define PK_ENABLE_STD_FUNCTION 0   // => 1
-```
-
-Then you can use standard capture list in lambda.
-
 ## Bind a class or struct
 
 Assume you have a struct `Point` declared as follows.

+ 0 - 7
include/pocketpy/common/config.h

@@ -24,13 +24,6 @@
 #define PK_GC_MIN_THRESHOLD         16384
 #endif
 
-// Whether to use `pkpy::function<>` to do bindings or not
-// By default, functions to be binded must be a C function pointer without capture
-// However, someone thinks it's not convenient.
-// By setting this to 1, capturing lambdas can be binded,
-// but it's slower and may cause "code bloat", it also needs more time to compile.
-#define PK_ENABLE_STD_FUNCTION      0
-
 /*************** debug settings ***************/
 // Do not edit the following settings unless you know what you are doing
 #define PK_DEBUG_CEVAL_STEP         0

+ 0 - 4
include/pocketpy/objects/codeobject.hpp

@@ -7,11 +7,7 @@
 
 namespace pkpy {
 
-#if PK_ENABLE_STD_FUNCTION
-using NativeFuncC = function<PyVar(VM*, ArgsView)>;
-#else
 typedef PyVar (*NativeFuncC)(VM*, ArgsView);
-#endif
 
 enum class BindType {
     DEFAULT,