12 #include "detail/common.h"
14 PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
20 options() : previous_state(global_state()) {}
23 options(
const options&) =
delete;
24 options& operator=(
const options&) =
delete;
28 global_state() = previous_state;
33 options& disable_user_defined_docstrings() & { global_state().show_user_defined_docstrings =
false;
return *
this; }
35 options& enable_user_defined_docstrings() & { global_state().show_user_defined_docstrings =
true;
return *
this; }
37 options& disable_function_signatures() & { global_state().show_function_signatures =
false;
return *
this; }
39 options& enable_function_signatures() & { global_state().show_function_signatures =
true;
return *
this; }
43 static bool show_user_defined_docstrings() {
return global_state().show_user_defined_docstrings; }
45 static bool show_function_signatures() {
return global_state().show_function_signatures; }
48 void*
operator new(size_t) =
delete;
53 bool show_user_defined_docstrings =
true;
54 bool show_function_signatures =
true;
57 static state &global_state() {
65 PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
The 'instance' type which needs to be standard layout (need to be able to use 'offsetof') ...