[libc-commits] [PATCH] D133163: [libc] add result class to strtointeger

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Dec 7 15:23:26 PST 2022


sivachandra accepted this revision.
sivachandra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/src/__support/str_to_num_result.h:16
+
+template <typename T> class StrToNumResult {
+  T return_val;
----------------
You can keep this a struct and avoid the getters. You can choose to keep the `has_error` method if you want.


================
Comment at: libc/src/__support/str_to_num_result.h:19
+  int error_val;
+  ptrdiff_t str_len;
+
----------------
Nit: `str_len` can be ambiguous. Name it `parsed_length` of something more indicative of what it is.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133163/new/

https://reviews.llvm.org/D133163



More information about the libc-commits mailing list