Clone this repo:
  1. b7f8cf0 libbase: update from upstream by Jim Pollock · 3 months ago firmware-asurada-13885.B firmware-quiche-13883.B master release-R89-13729.B release-R90-13816.B release-R91-13904.B stabilize-13729.16.B stabilize-13729.45.B stabilize-13729.49.B stabilize-13729.56.B stabilize-13729.57.B stabilize-13729.72.B stabilize-13768.B stabilize-13799.B stabilize-13816.40.B stabilize-13816.51.B stabilize-13821.B stabilize-13836.B stabilize-13851.B stabilize-13856.B stabilize-13895.B stabilize-coil-13902.B stabilize-glibc-13901.B stabilize-quickfix-13729.60.B stabilize-quickfix-13729.73.B stabilize-quickfix-13729.84.B stabilize-rust-13720.B stabilize-rust-13776.B stabilize-rust-13795.B stabilize-rust-13836.B
  2. be15867 Add NOTICE file by Adam Barth · 3 months ago
  3. 3b0ce70 Delete android::base::expected::operator bool() by Bernie Innocenti · 4 months ago
  4. 2b1b0bc Use the renamed __ANDROID_APEX_MIN_SDK_VERSION__. am: 361fdad185 by Dan Albert · 5 months ago
  5. 361fdad Use the renamed __ANDROID_APEX_MIN_SDK_VERSION__. by Dan Albert · 5 months ago


Who is this library for?

This library is a collection of convenience functions to make common tasks easier and less error-prone.

In this context, “error-prone” covers both “hard to do correctly” and “hard to do with good performance”, but as a general purpose library, libbase's primary focus is on making it easier to do things easily and correctly when a compromise has to be made between “simplest API” on the one hand and “fastest implementation” on the other. Though obviously the ideal is to have both.

Should my routine be added?

The intention is to cover the 80% use cases, not be all things to all users.

If you have a routine that‘s really useful in your project, congratulations. But that doesn’t mean it should be here rather than just in your project.

The question for libbase is “should everyone be doing this?”/“does this make everyone's code cleaner/safer?”. Historically we've considered the bar for inclusion to be “are there at least three unrelated projects that would be cleaned up by doing so”.

If your routine is actually something from a future C++ standard (that isn‘t yet in libc++), or it’s widely used in another library, that helps show that there's precedent. Being able to say “so-and-so has used this API for n years” is a good way to reduce concerns about API choices.

Any other restrictions?

Unlike most Android code, code in libbase has to build for Mac and Windows too.

Code here is also expected to have good test coverage.

By its nature, it‘s difficult to change libbase API. It’s often best to start using your routine just in your project, and let it “graduate” after you're certain that the API is solid.