15 return "test_function()";
32 const char *
data =
"\x01\x00\x02\x00";
33 return std::string(data, 4);
37 std::string
ret =
"bytes[";
38 const auto value =
static_cast<std::string
>(bytes);
39 for (
size_t i = 0;
i <
value.length(); ++
i) {
49 int f1(
int x) noexcept {
return x+1; }
50 int f2(
int x) noexcept(
true) {
return x+2; }
51 int f3(
int x) noexcept(
false) {
return x+3; }
53 # pragma GCC diagnostic push 54 # pragma GCC diagnostic ignored "-Wdeprecated" 56 int f4(
int x)
throw() {
return x+4; }
58 # pragma GCC diagnostic pop 61 int m1(
int x) noexcept {
return x-1; }
62 int m2(
int x)
const noexcept {
return x-2; }
63 int m3(
int x) noexcept(
true) {
return x-3; }
64 int m4(
int x)
const noexcept(
true) {
return x-4; }
65 int m5(
int x) noexcept(
false) {
return x-5; }
66 int m6(
int x)
const noexcept(
false) {
return x-6; }
68 # pragma GCC diagnostic push 69 # pragma GCC diagnostic ignored "-Wdeprecated" 71 int m7(
int x)
throw() {
return x-7; }
72 int m8(
int x)
const throw() {
return x-8; }
74 # pragma GCC diagnostic pop 82 m.attr(
"some_constant") =
py::int_(14);
89 #if defined(PYBIND11_OVERLOAD_CAST)
test_initializer constants_and_functions("constants_and_functions", test_submodule_constants_and_functions)
int f3(int x) noexcept(false)
int m5(int x) noexcept(false)
int m4(int x) const noexcept(true)
arr data(const arr &a, Ix... index)
Binds C++ enumerations and enumeration classes to Python.
std::string test_function1()
int f2(int x) noexcept(true)
size_t function_call handle ret
op_< op_int, op_u, self_t, undefined_t > int_(const self_t &)
int m3(int x) noexcept(true)
std::string print_bytes(py::bytes bytes)
int m6(int x) const noexcept(false)
int m2(int x) const noexcept
#define TEST_SUBMODULE(name, variable)
std::string test_function2(MyEnum k)
bool typename Extra class_ & def(const char *name_, Func &&f, const Extra &... extra)
std::string test_function3(int i)
auto to_string(T &&value) -> decltype(std::forward< T >(value))
Convert an object to a string (directly forward if this can become a string)