mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
style: 统一 requires 格式
This commit is contained in:
@@ -41,7 +41,7 @@ namespace asst
|
||||
|
||||
template<typename PluginType>
|
||||
std::shared_ptr<PluginType> register_plugin()
|
||||
requires(std::is_base_of_v<AbstractTaskPlugin, PluginType>) // Plugin must inherit AbstractTaskPlugin
|
||||
requires std::is_base_of_v<AbstractTaskPlugin, PluginType> // Plugin must inherit AbstractTaskPlugin
|
||||
{
|
||||
auto plugin = std::make_shared<PluginType>(m_callback, m_callback_arg, m_task_chain);
|
||||
m_plugins.emplace(plugin);
|
||||
|
||||
@@ -45,8 +45,8 @@ namespace asst::utils
|
||||
|
||||
template<typename map_t>
|
||||
inline std::string string_replace_all_batch(const std::string& src, const map_t& replace_pairs)
|
||||
requires(std::is_base_of_v<typename map_t::value_type::first_type, std::string>
|
||||
&& std::is_base_of_v<typename map_t::value_type::second_type, std::string>)
|
||||
requires std::is_base_of_v<typename map_t::value_type::first_type, std::string>
|
||||
&& std::is_base_of_v<typename map_t::value_type::second_type, std::string>
|
||||
{
|
||||
std::string str = src;
|
||||
for (const auto& [old_value, new_value] : replace_pairs) {
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace asst
|
||||
const std::unordered_set<std::string>& get_templ_required() const noexcept;
|
||||
|
||||
template<typename TargetTaskInfoType = TaskInfo>
|
||||
requires(std::is_base_of_v<TaskInfo, TargetTaskInfoType>) // Parameter must be a TaskInfo
|
||||
requires std::is_base_of_v<TaskInfo, TargetTaskInfoType> // Parameter must be a TaskInfo
|
||||
std::shared_ptr<TargetTaskInfoType> get(const std::string& name)
|
||||
{
|
||||
auto it = m_all_tasks_info.find(name);
|
||||
|
||||
Reference in New Issue
Block a user