aboutsummaryrefslogtreecommitdiff
path: root/python/paludis_python.hh
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-29 21:47:08 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-03 21:20:26 +0100
commit77be16f5c2de2ebcd7ce78084755f83c522edc39 (patch)
tree7f46de7cf0f1cd9ec9cd2c4b342446cd0c4d567c /python/paludis_python.hh
parent5c42e4800f4e6edd91dc6d8cdf54afb3d1fb34df (diff)
downloadpaludis-77be16f5c2de2ebcd7ce78084755f83c522edc39.tar.gz
paludis-77be16f5c2de2ebcd7ce78084755f83c522edc39.tar.xz
Kill kc. Breaks python.
Diffstat (limited to 'python/paludis_python.hh')
-rw-r--r--python/paludis_python.hh17
1 files changed, 9 insertions, 8 deletions
diff --git a/python/paludis_python.hh b/python/paludis_python.hh
index eb4d4a449..735957cab 100644
--- a/python/paludis_python.hh
+++ b/python/paludis_python.hh
@@ -23,6 +23,7 @@
#include <python/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/attributes.hh>
+#include <paludis/util/named_value-fwd.hh>
#include <boost/python.hpp>
#include <tr1/memory>
@@ -154,18 +155,18 @@ namespace paludis
}
};
- // helper for kc getters
- template <typename C_, typename T_, typename K_>
- T_ kc_getter(const C_ & c)
+ // helper for named values
+ template <typename C_, typename K_, typename T_, NamedValue<K_, T_> (C_::* c_)>
+ T_ named_values_getter(const C_ & c)
{
- return c[K_()];
+ return (c.*c_)();
}
- // helper for kc setters
- template <typename C_, typename T_, typename K_>
- void kc_setter(C_ & c, const T_ & t)
+ // helper for named values
+ template <typename C_, typename K_, typename T_, NamedValue<K_, T_> (C_::* c_)>
+ void named_values_setter(C_ & c, const T_ & t)
{
- c[K_()] = t;
+ (c.*c_)() = t;
}
} // namespace paludis::python
} // namespace paludis