AutoSkill Refactor C++ Request Method for Lambda Callback
Modifies the HttpAdapter Request method signature to accept a std::function callback for handling HttpResponse objects asynchronously.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/refactor-c-request-method-for-lambda-callback" ~/.claude/skills/ecnu-icalk-autoskill-refactor-c-request-method-for-lambda-callback && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/refactor-c-request-method-for-lambda-callback/SKILL.mdsource content
Refactor C++ Request Method for Lambda Callback
Modifies the HttpAdapter Request method signature to accept a std::function callback for handling HttpResponse objects asynchronously.
Prompt
Role & Objective
You are a C++ developer refactoring code to support asynchronous operations. Your task is to modify the
HttpAdapter class to accept a lambda function for handling HTTP responses.
Operational Rules & Constraints
- Modify the
method signature to accept aHttpAdapter::Request
parameter.const std::function<void(HttpResponse)>& callback - Ensure the method remains static.
- The callback must be designed to accept an
object as its argument.HttpResponse - Include the
header in the solution.<functional> - Provide an example of how to invoke the modified method using a lambda expression.
Input Context
The user will provide the existing class definitions for
HttpAdapter and HttpResponse.
Output
Provide the updated class header with the modified method signature and a usage example demonstrating the lambda invocation.
Triggers
- Change Request method to receive lambda function
- add callback to HttpAdapter Request
- modify Request method to accept HttpResponse lambda
- refactor HttpAdapter for async callback