--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>pybind_external_overload_docs.Class26 | My Python Project</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+ <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Python Project</a>
+ </div>
+ </div>
+</nav></header>
+<main><article>
+ <div class="m-container m-container-inflatable">
+ <div class="m-row">
+ <div class="m-col-l-10 m-push-l-1">
+ <h1>
+ <span class="m-breadcrumb"><a href="pybind_external_overload_docs.html">pybind_external_overload_docs</a>.<wbr/></span>Class26 <span class="m-thin">class</span>
+ </h1>
+ <p>Pybind 2.6 features</p>
+ <nav class="m-block m-default">
+ <h3>Contents</h3>
+ <ul>
+ <li>
+ Reference
+ <ul>
+ <li><a href="#methods">Methods</a></li>
+ <li><a href="#data">Data</a></li>
+ </ul>
+ </li>
+ </ul>
+ </nav>
+ <section id="methods">
+ <h2><a href="#methods">Methods</a></h2>
+ <dl class="m-doc">
+ <dt>
+ <span class="m-doc-wrap-bumper">def <a href="#foo" class="m-doc">foo</a>(</span><span class="m-doc-wrap">self,
+ a: int<span class="m-text m-dim">, /</span>,
+ b: float,<span class="m-text m-dim"> *,</span>
+ keyword: str) -> None</span>
+ </dt>
+ <dd>Positional and keyword-only arguments</dd>
+ </dl>
+ </section>
+ <section id="data">
+ <h2><a href="#data">Data</a></h2>
+ <dl class="m-doc">
+ <dt id="is_pybind26">
+ <a href="#is_pybind26" class="m-doc-self">is_pybind26</a> = True
+ </dt>
+ <dd></dd>
+ </dl>
+ </section>
+ <section>
+ <h2>Method documentation</h2>
+ <section class="m-doc-details" id="foo"><div>
+ <h3>
+ <span class="m-doc-wrap-bumper">def pybind_external_overload_docs.<wbr />Class26.<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#foo" class="m-doc-self">foo</a>(</span><span class="m-doc-wrap">self,
+ a: int<span class="m-text m-dim">, /</span>,
+ b: float,<span class="m-text m-dim"> *,</span>
+ keyword: str) -> None</span></span>
+ </h3>
+ <p>Positional and keyword-only arguments</p>
+<p>The <code>/</code> and <code>*</code> are excluded from matching.</p>
+ </div></section>
+ </section>
+ </div>
+ </div>
+ </div>
+</article></main>
+</body>
+</html>
void foo2(std::string) {}
};
+struct Class26 {
+ void foo1(int) {}
+ void foo2(int, float, const std::string&) {}
+};
+
PYBIND11_MODULE(pybind_external_overload_docs, m) {
m.doc() = "pybind11 external overload docs";
py::class_<Class>(m, "Class", "My fun class!")
.def("foo", &Class::foo1, "First overload", py::arg("index"))
.def("foo", &Class::foo2, "Second overload", py::arg("name"));
+
+ py::class_<Class26> pybind26{m, "Class26", "Pybind 2.6 features"};
+
+ /* Checker so the Python side can detect if testing pybind 2.6 features is
+ feasible */
+ pybind26.attr("is_pybind26") =
+ #if PYBIND11_VERSION_MAJOR*100 + PYBIND11_VERSION_MINOR >= 206
+ true
+ #else
+ false
+ #endif
+ ;
+
+ #if PYBIND11_VERSION_MAJOR*100 + PYBIND11_VERSION_MINOR >= 206
+ pybind26
+ .def("foo", &Class26::foo2, "Positional and keyword-only arguments", py::arg("a"), py::pos_only{}, py::arg("b"), py::kw_only{}, py::arg("keyword"));
+ #endif
}