Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:31

0001 // Copyright Antony Polukhin, 2016-2023.
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See
0004 // accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_STACKTRACE_DETAIL_TRY_DEC_CONVERT_HPP
0008 #define BOOST_STACKTRACE_DETAIL_TRY_DEC_CONVERT_HPP
0009 
0010 #include <boost/config.hpp>
0011 #ifdef BOOST_HAS_PRAGMA_ONCE
0012 #   pragma once
0013 #endif
0014 
0015 #include <cstdlib>
0016 
0017 namespace boost { namespace stacktrace { namespace detail {
0018 
0019 // We do not use boost::lexical_cast in this function to reduce module dependencies
0020 inline bool try_dec_convert(const char* s, std::size_t& res) noexcept {
0021     char* end_ptr = 0;
0022     res = std::strtoul(s, &end_ptr, 10);
0023     return *end_ptr == '\0';
0024 }
0025 
0026 
0027 }}} // namespace boost::stacktrace::detail
0028 
0029 #endif // BOOST_STACKTRACE_DETAIL_TRY_DEC_CONVERT_HPP