style: 统一 requires 格式

This commit is contained in:
zzyyyl
2022-08-02 00:39:55 +08:00
parent 4976628c06
commit 4bd8bda518
3 changed files with 4 additions and 4 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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);