xref: /freebsd-src/contrib/llvm-project/libcxx/include/__charconv/from_chars_result.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
1349cc55cSDimitry Andric // -*- C++ -*-
2349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
3349cc55cSDimitry Andric //
4349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
6349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7349cc55cSDimitry Andric //
8349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
9349cc55cSDimitry Andric 
10349cc55cSDimitry Andric #ifndef _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
11349cc55cSDimitry Andric #define _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
12349cc55cSDimitry Andric 
13349cc55cSDimitry Andric #include <__config>
1406c3fb27SDimitry Andric #include <__system_error/errc.h>
15349cc55cSDimitry Andric 
16349cc55cSDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17349cc55cSDimitry Andric #  pragma GCC system_header
18349cc55cSDimitry Andric #endif
19349cc55cSDimitry Andric 
20349cc55cSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
21349cc55cSDimitry Andric 
2206c3fb27SDimitry Andric #if _LIBCPP_STD_VER >= 17
23349cc55cSDimitry Andric 
2406c3fb27SDimitry Andric struct _LIBCPP_EXPORTED_FROM_ABI from_chars_result {
25349cc55cSDimitry Andric   const char* ptr;
26349cc55cSDimitry Andric   errc ec;
2706c3fb27SDimitry Andric #  if _LIBCPP_STD_VER >= 20
28349cc55cSDimitry Andric   _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
29349cc55cSDimitry Andric #  endif
30*5f757f3fSDimitry Andric #  if _LIBCPP_STD_VER >= 26
31*5f757f3fSDimitry Andric   _LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return ec == errc{}; }
32*5f757f3fSDimitry Andric #  endif
33349cc55cSDimitry Andric };
34349cc55cSDimitry Andric 
3506c3fb27SDimitry Andric #endif // _LIBCPP_STD_VER >= 17
36349cc55cSDimitry Andric 
37349cc55cSDimitry Andric _LIBCPP_END_NAMESPACE_STD
38349cc55cSDimitry Andric 
39349cc55cSDimitry Andric #endif // _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
40