mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-21 13:30:26 +00:00
Add type_caster<std::monostate> (#3818)
* Add type_caster<std::monostate> for std::variant Add type_caster<std::monostate>, allowing std::variant<std::monostate, ...> * Add variant<std::monostate, ...> test methods * Add std::monostate tests * Update test_stl.py Remove erroneous extra tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update test fn name * And update the doc() test Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -406,6 +406,9 @@ struct variant_caster<V<Ts...>> {
|
||||
#if defined(PYBIND11_HAS_VARIANT)
|
||||
template <typename... Ts>
|
||||
struct type_caster<std::variant<Ts...>> : variant_caster<std::variant<Ts...>> {};
|
||||
|
||||
template <>
|
||||
struct type_caster<std::monostate> : public void_caster<std::monostate> {};
|
||||
#endif
|
||||
|
||||
PYBIND11_NAMESPACE_END(detail)
|
||||
|
||||
Reference in New Issue
Block a user