aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-01 16:11:42 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-04 08:32:59 +0100
commit3b25615aefb36ae747c29220ff80b6de2934c034 (patch)
treefdbb0863c28cceb664262bb12b01557fd9b61566
parent28626b8aa3b39d400f8f9eb3a0730ac101b2e53a (diff)
downloadpaludis-3b25615aefb36ae747c29220ff80b6de2934c034.tar.gz
paludis-3b25615aefb36ae747c29220ff80b6de2934c034.tar.xz
Avoid explicit instantiation of variadics
-rw-r--r--paludis/package_dep_spec_constraint.cc6
-rw-r--r--paludis/util/pool-impl.hh34
-rw-r--r--paludis/util/pool.hh14
3 files changed, 50 insertions, 4 deletions
diff --git a/paludis/package_dep_spec_constraint.cc b/paludis/package_dep_spec_constraint.cc
index b1e6b96..22b20e0 100644
--- a/paludis/package_dep_spec_constraint.cc
+++ b/paludis/package_dep_spec_constraint.cc
@@ -157,7 +157,7 @@ InstallableToPathConstraint::include_masked() const
template class Pool<InstallableToPathConstraint>;
template class Singleton<Pool<InstallableToPathConstraint> >;
template const std::shared_ptr<const InstallableToPathConstraint> Pool<InstallableToPathConstraint>::create(
- const FSPath &, const bool & ...) const;
+ const FSPath &, const bool &) const;
InstallableToRepositoryConstraint::InstallableToRepositoryConstraint(const RepositoryName & n, const bool i) :
_name(n),
@@ -182,7 +182,7 @@ InstallableToRepositoryConstraint::include_masked() const
template class Pool<InstallableToRepositoryConstraint>;
template class Singleton<Pool<InstallableToRepositoryConstraint> >;
template const std::shared_ptr<const InstallableToRepositoryConstraint> Pool<InstallableToRepositoryConstraint>::create(
- const RepositoryName &, const bool & ...) const;
+ const RepositoryName &, const bool &) const;
ExactSlotConstraint::ExactSlotConstraint(const SlotName & n, const bool i) :
_name(n),
@@ -206,7 +206,7 @@ ExactSlotConstraint::locked() const
template class Pool<ExactSlotConstraint>;
template class Singleton<Pool<ExactSlotConstraint> >;
-template const std::shared_ptr<const ExactSlotConstraint> Pool<ExactSlotConstraint>::create(const SlotName &, const bool & ...) const;
+template const std::shared_ptr<const ExactSlotConstraint> Pool<ExactSlotConstraint>::create(const SlotName &, const bool &) const;
AnySlotConstraint::AnySlotConstraint(const bool i) :
_locking(i)
diff --git a/paludis/util/pool-impl.hh b/paludis/util/pool-impl.hh
index aa02d22..30142f3 100644
--- a/paludis/util/pool-impl.hh
+++ b/paludis/util/pool-impl.hh
@@ -89,7 +89,7 @@ namespace paludis
template <typename T_>
template <typename... Args_>
const std::shared_ptr<const T_>
- Pool<T_>::create(const Args_ & ... args) const
+ Pool<T_>::really_create(const Args_ & ... args) const
{
PoolKeys keys;
keys.add(args...);
@@ -108,6 +108,38 @@ namespace paludis
}
template <typename T_>
+ template <typename... Args_>
+ const std::shared_ptr<const T_>
+ Pool<T_>::create(const Args_ & ... args) const
+ {
+ return really_create(args...);
+ }
+
+ template <typename T_>
+ template <typename T1_>
+ const std::shared_ptr<const T_>
+ Pool<T_>::create(const T1_ & a1) const
+ {
+ return really_create(a1);
+ }
+
+ template <typename T_>
+ template <typename T1_, typename T2_>
+ const std::shared_ptr<const T_>
+ Pool<T_>::create(const T1_ & a1, const T2_ & a2) const
+ {
+ return really_create(a1, a2);
+ }
+
+ template <typename T_>
+ template <typename T1_, typename T2_, typename T3_>
+ const std::shared_ptr<const T_>
+ Pool<T_>::create(const T1_ & a1, const T2_ & a2, const T3_ & a3) const
+ {
+ return really_create(a1, a2, a3);
+ }
+
+ template <typename T_>
ConcretePoolKey<T_>::ConcretePoolKey(const T_ & t) :
PoolKey(PoolKeyTypeCodes::get<T_>()),
_value(t)
diff --git a/paludis/util/pool.hh b/paludis/util/pool.hh
index 6ad9420..b3adc4d 100644
--- a/paludis/util/pool.hh
+++ b/paludis/util/pool.hh
@@ -42,9 +42,23 @@ namespace paludis
Pool();
~Pool();
+ template <typename... Args_>
+ const std::shared_ptr<const T_> really_create(const Args_ & ...) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
public:
template <typename... Args_>
const std::shared_ptr<const T_> create(const Args_ & ...) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ // can't explicitly instantiate variadics
+
+ template <typename T1_>
+ const std::shared_ptr<const T_> create(const T1_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ template <typename T1_, typename T2_>
+ const std::shared_ptr<const T_> create(const T1_ &, const T2_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ template <typename T1_, typename T2_, typename T3_>
+ const std::shared_ptr<const T_> create(const T1_ &, const T2_ &, const T3_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE PoolKey