diff --git a/include/boost/python/args.hpp b/include/boost/python/args.hpp index 4dc4055e..ed903962 100644 --- a/include/boost/python/args.hpp +++ b/include/boost/python/args.hpp @@ -36,20 +36,9 @@ typedef detail::keywords<1> arg; namespace detail { - // A hack to simplify code by making arg a dependent name - template - struct dependent_arg - { - typedef arg type; - }; - template struct keywords_base { - typedef typename - dependent_arg::type - arg; - BOOST_STATIC_CONSTANT(std::size_t, size = nkeywords); keyword_range range() const @@ -59,20 +48,11 @@ namespace detail keyword elements[nkeywords]; - keywords operator,(arg const &k) const - { - keywords const& l = *static_cast const*>(this); - python::detail::keywords res; - std::copy(l.elements, l.elements+nkeywords, res.elements); - res.elements[nkeywords] = k.elements[0]; - return res; - } - + keywords + operator,(arg const &k) const; + keywords - operator,(char const *name) const - { - return this->operator,(python::arg(name)); - } + operator,(char const *name) const; }; template @@ -102,6 +82,26 @@ namespace detail } }; + template + inline + keywords + keywords_base::operator,(arg const &k) const + { + keywords const& l = *static_cast const*>(this); + python::detail::keywords res; + std::copy(l.elements, l.elements+nkeywords, res.elements); + res.elements[nkeywords] = k.elements[0]; + return res; + } + + template + inline + keywords + keywords_base::operator,(char const *name) const + { + return this->operator,(python::arg(name)); + } + # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct is_keywords