add("generate", &Loader::generate);
add("install", &Loader::component<InstallComponent>);
add("interface_version", &Loader::interface_version);
- add("library", &Loader::component_arg<BinaryComponent, BinaryComponent::Type>, BinaryComponent::LIBRARY);
- add("module", &Loader::component_arg<BinaryComponent, BinaryComponent::Type>, BinaryComponent::MODULE);
- add("program", &Loader::component_arg<BinaryComponent, BinaryComponent::Type>, BinaryComponent::PROGRAM);
+ add("library", &Loader::component<BinaryComponent, BinaryComponent::Type>, BinaryComponent::LIBRARY);
+ add("module", &Loader::component<BinaryComponent, BinaryComponent::Type>, BinaryComponent::MODULE);
+ add("program", &Loader::component<BinaryComponent, BinaryComponent::Type>, BinaryComponent::PROGRAM);
add("source_archive", &Loader::source_archive);
add("source_tarball", &Loader::source_archive);
add("tarball", &Loader::tarball);
}
}
-template<typename C>
-void SourcePackage::Loader::component(const string &n)
+template<typename C, typename... Args>
+void SourcePackage::Loader::component(Args... args, const string &n)
{
- C *comp = new C(obj, n);
- load_sub(*comp);
- obj.components.push_back(comp);
-}
-
-template<typename C, typename A>
-void SourcePackage::Loader::component_arg(A a, const string &n)
-{
- C *comp = new C(obj, n, a);
+ C *comp = new C(obj, n, args...);
load_sub(*comp);
obj.components.push_back(comp);
}
void finish() override;
void feature(const std::string &, const std::string &);
- template<typename C>
- void component(const std::string &);
- template<typename C, typename A>
- void component_arg(A, const std::string &);
+ template<typename C, typename... Args>
+ void component(Args..., const std::string &);
void build_info();
void generate(const std::string &);
void interface_version(const std::string &);