Convert string S to an integer of type N using radix Base.

Synopsis

Declared in <llvm/ADT/StringExtras.h>

template<typename N>
bool
to_integer(
    StringRef S,
    N& Num,
    unsigned int Base = 0);

Description

If Base is 0, auto‐detects the radix. Returns true if the number was successfully converted, false otherwise.

Return Value

True if the conversion succeeded.

Parameters

Name

Description

S

text to parse

Num

set to the parsed value on success

Base

radix to use, or 0 to auto‐detect

Created with MrDocs