Re-sync with internal repository
[hiphop-php.git] / third-party / folly / src / folly / python / optional.pxd
blob973cf71e765540e55f56dcdc2491d0d81704b83b
1 # Copyright (c) Meta Platforms, Inc. and affiliates.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 #     http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 cdef extern from "folly/Optional.h" namespace "folly" nogil:
16     cdef cppclass cOptional "folly::Optional"[T]:
17         cOptional()
18         cOptional(T val)
19         bint has_value()
20         T value()
21         T value_or(T&& altValue)
22         T* get_pointer()
23         void reset()
24         void assign(T&& newValue)
26     cOptional[T] make_optional[T](...) except +