John Wellbelove

Results 171 comments of John Wellbelove

Do you think that the string passed should only contain the numeric string to convert, or should it search for the start and end of the numeric? i.e. find non-numeric...

That would definitely be the easiest to implement, and it separates the two steps of 'search' & 'convert', though I would probably let the conversion functions automatically ignore leading and...

Including conversion of strings in binary, octal & hex formats? It may need an explicit base parameter or deduction from the prefix. ``` etl::to_arithmetic("1234", etl::hex()); etl::to_arithmetic("0x1234"); ```

- The return type of the functions will be an `etl::optional`, where `T` is an arithmetic type. - A failure to convert will result in a default constructed `etl::optional`. -...

Examples: `" +123 "` as signed decimal OK `" -123 "` as signed decimal OK `" -123 "` as unsigned decimal FAILURE `" +123 "` as unsigned hex OK `"...

At the moment, `""` is not an error (and returns a default constructed `etl::optional`), but `"-"` or `"+"` _are_ errors.

Sorry for my confusing description. When I said 'errors' I meant a call to `ETL_ASSERT`. A return of a default constructed `etl::optional` is of course a '_failure to convert_' error,...

How important is the ability to have a `constexpr` conversion? At the moment I am returning `etl::optional`. Unfortunately, `etl::optional` cannot be `constexpr` due to the aligned storage member. EDIT: I...