| 513 | "visitor::result_type is required by boost::variant in C++11 mode"); |
| 514 | |
| 515 | struct visitor { |
| 516 | using result_type = const char *; |
| 517 | |
| 518 | result_type operator()(int) { return "int"; } |
| 519 | result_type operator()(const std::string &) { return "std::string"; } |
| 520 | result_type operator()(double) { return "double"; } |
| 521 | result_type operator()(std::nullptr_t) { return "std::nullptr_t"; } |
| 522 | # if defined(PYBIND11_HAS_VARIANT) |
| 523 | result_type operator()(std::monostate) { return "std::monostate"; } |
| 524 | # endif |
| 525 | }; |
| 526 | |
| 527 | // test_variant |
| 528 | m.def("load_variant", [](const variant<int, std::string, double, std::nullptr_t> &v) { |
no outgoing calls