xte ::big_int <T >::parse .with_index ()
Defined in header <xte/math/big_int.hpp> Definition
Same astemplate <xte ::is_int Radix =xte ::uz > [[nodiscard ]]static constexpr auto with_index (xte ::string_view string ,Radix radix =10 ,const xte ::number_format_config & config = {})noexcept (false );
xte ::big_int <T >::parse .operator() (), but returns a struct containing non-static data members value and index , which hold the parsed big-integer and the index at which parsing stopped, respectively.Example
Output:auto [value ,index ] =xte ::big_int <>::parse .with_index ("-123a" );std ::println ("value = {}" ,value );std ::println ("index = {}" ,index );
[View in Compiler Explorer]value = -123 index = 4