Skip to content

Commit

Permalink
fix absl optional type caster
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Mar 3, 2022
1 parent 1f8134b commit 269743c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python-webrtc/cpp/src/utils/absl_optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@

#pragma once

#ifndef ABSL_USES_STD_OPTIONAL

#include <pybind11/cast.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "absl/types/optional.h"
#include <absl/types/optional.h>

namespace pybind11::detail {
template<typename T> struct type_caster<absl::optional < T>>: public optional_caster <absl::optional<T>> {};
template<typename T> struct type_caster<absl::optional<T>>: public optional_caster<absl::optional<T>> {};
template<> struct type_caster<absl::nullopt_t> : public void_caster<absl::nullopt_t> {};
} // namespace pybind11::detail

#endif // ABSL_USES_STD_OPTIONAL

0 comments on commit 269743c

Please sign in to comment.