19 std::string
test_function3(
int i) {
return "test_function(" + std::to_string(
i) +
")"; }
27 const char *
data =
"\x01\x00\x02\x00";
28 return std::string(
data, 4);
32 std::string
ret =
"bytes[";
33 const auto value =
static_cast<std::string
>(
bytes);
35 ret += std::to_string(
static_cast<int>(
c)) +
' ';
48 #if defined(__INTEL_COMPILER) && defined(PYBIND11_CPP17)
49 int f1(
int x) noexcept(
true) {
return x + 1; }
51 int f1(
int x) noexcept {
return x + 1; }
53 int f2(
int x) noexcept(
true) {
return x + 2; }
54 int f3(
int x) noexcept(
false) {
return x + 3; }
57 #if defined(__clang_major__) && __clang_major__ >= 5
63 int f4(
int x)
throw() {
return x + 4; }
66 int m1(
int x) noexcept {
return x - 1; }
67 int m2(
int x)
const noexcept {
return x - 2; }
68 int m3(
int x) noexcept(
true) {
return x - 3; }
69 int m4(
int x)
const noexcept(
true) {
return x - 4; }
70 int m5(
int x) noexcept(
false) {
return x - 5; }
71 int m6(
int x)
const noexcept(
false) {
return x - 6; }
76 int m7(
int x) throw() {
return x - 7; }
78 int m8(
int x)
const throw() {
return x - 8; }
85 m.attr(
"some_constant") = py::int_(14);
92 #if defined(PYBIND11_OVERLOAD_CAST)
104 py::enum_<MyEnum>(
m,
"MyEnum")
115 py::class_<C>(
m,
"C")
128 PYBIND11_WARNING_PUSH
136 m.def(
"register_large_capture_with_invalid_arguments", [](py::module_
m) {
140 #if defined(__GNUC__) && __GNUC__ == 4 // CentOS7
146 m.def(
"register_with_raising_repr", [](py::module_
m,
const py::object &default_value) {
149 [](
int,
int,
const py::object &) {
return 42; },
152 py::arg_v(
"y", 42,
"<the answer>"),
153 py::arg_v(
"z", default_value));
157 m.def(
"l1", []() noexcept(
true) {
return 0; });