Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions phlex/model/product_specification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,17 @@ namespace phlex::experimental {
return {algorithm_name::create(""), s, type_id{}};
}

product_specifications to_product_specifications(std::string const& name,
product_specifications to_product_specifications(std::string const name,
std::vector<std::string> output_labels,
std::vector<type_id> output_types)
{
assert(output_labels.size() == output_types.size());
product_specifications outputs;
outputs.reserve(output_labels.size());

to_product_specification make_product_specification{name};
// zip view isn't available until C++23 so we have to use a loop over the index
for (std::size_t i = 0; i < output_labels.size(); ++i) {
outputs.push_back(make_product_specification(output_labels.at(i), output_types.at(i)));
outputs.emplace_back(name, output_labels[i], output_types[i]);
}
return outputs;
}
Expand Down
14 changes: 1 addition & 13 deletions phlex/model/product_specification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,7 @@ namespace phlex::experimental {

using product_specifications = std::vector<product_specification>;

class to_product_specification {
public:
explicit to_product_specification(algorithm_name const& qualifier) : qualifier_{qualifier} {}
product_specification operator()(std::string const& name, type_id type) const
{
return product_specification{qualifier_, name, std::move(type)};
}

private:
algorithm_name const& qualifier_;
};

product_specifications to_product_specifications(std::string const& name,
product_specifications to_product_specifications(std::string name,
std::vector<std::string> output_labels,
std::vector<type_id> output_types);
}
Expand Down
Loading