Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 08:19:40

0001 // Copyright 2023 Matt Borland
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // https://www.boost.org/LICENSE_1_0.txt
0004 
0005 #ifndef BOOST_CHARCONV_DETAIL_TO_CHARS_RESULT_HPP
0006 #define BOOST_CHARCONV_DETAIL_TO_CHARS_RESULT_HPP
0007 
0008 #include <system_error>
0009 
0010 // 22.13.2, Primitive numerical output conversion
0011 
0012 namespace boost { namespace charconv {
0013 
0014 struct to_chars_result
0015 {
0016     char *ptr;
0017     std::errc ec;
0018 
0019     constexpr friend bool operator==(const to_chars_result &lhs, const to_chars_result &rhs) noexcept
0020     {
0021         return lhs.ptr == rhs.ptr && lhs.ec == rhs.ec;
0022     }
0023 
0024     constexpr friend bool operator!=(const to_chars_result &lhs, const to_chars_result &rhs) noexcept
0025     {
0026         return !(lhs == rhs);
0027     }
0028 
0029     constexpr explicit operator bool() const noexcept { return ec == std::errc{}; }
0030 };
0031 
0032 }} // Namespaces
0033 
0034 #endif //BOOST_CHARCONV_DETAIL_TO_CHARS_RESULT_HPP