{#
    C++ template support
#}

{% import "pybind11.cpp.j2" as pybind11 %}

namespace rpygen {

{% if cls.namespace %}
using namespace {{ cls.namespace }};
{% endif %}

{% for using in header.using.values() if using.using_type != "typealias" %}
using {{ using.raw_type }};
{% endfor %}

template <{{ cls.x_template_parameter_list }}>
inline void bind_{{ cls.x_qualname_ }}(py::module &m, const char * clsName) {

    {{ pybind11.cls_using(cls) }}

    {# TODO: embedded structs will fail here #}
    {{ pybind11.cls_decl(cls, cls.x_varname, "clsName") }}

    {{ pybind11.cls_methods(cls, cls.x_varname) }}

    {{ cls.data.template_inline_code }}
}

}; // namespace rpygen
