Giter Site home page Giter Site logo

dongfengxin / au Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aurora-opensource/au

0.0 0.0 0.0 7.55 MB

A C++14-compatible physical units library with no dependencies and a single-file delivery option. Emphasis on safety, accessibility, performance, and developer experience.

License: Apache License 2.0

Shell 0.76% C++ 93.63% Python 1.74% Starlark 3.87%

au's Introduction

Au library logo

clang14-ubuntu clang11-ubuntu gcc10-ubuntu MSVC x64 19.29 MSVC x64 19.35

Au: A C++14-compatible units library, by Aurora

Au (pronounced "ay yoo") is a C++ units library, by Aurora. What the <chrono> library did for time variables, Au does for all physical quantities (lengths, speeds, voltages, and so on). Namely:

  • Catch unit errors at compile time, with no runtime penalty.
  • Make unit conversions effortless to get right.
  • Accelerate and improve your general developer experience.

In short: if your C++ programs handle physical quantities, Au will make you faster and more effective at your job. You'll find everything you need in our full documentation website.

Try it out on Compiler Explorer ("godbolt")!

Why Au?

There are many other C++ units libraries, several quite well established. Each of them offers some of the following properties, but only Au offers all of them:

  • Wide compatibility with C++ versions (anything C++14 or newer).
  • Easy installation in any project (including a customizable single-header option).
  • Small compile time burden.
  • Concise, readable typenames in compiler errors.

We also provide several totally new features, including fully unit-safe APIs, an adaptive "safety surface" that protects conversions against overflow, unit-aware rounding and inverse functions, and many more.

Forged in the crucible of Aurora's diverse, demanding use cases, Au has a proven track record of usability and reliability. This includes embedded support: Aurora's embedded teams have been first class customers since the library's inception.

To learn more about our place in the C++ units library ecosystem, see our detailed library comparison.

Getting started

Our installation instructions can have you up and running in minutes, in any project that supports C++14 or newer.

To use the library effectively, we recommend working through the tutorials, starting with Au 101: Quantity Makers. To get set up with the tutorials โ€” or, to contribute to the library โ€” check out our development guide.

As seen at CppCon 2021

At CppCon 2021, we presented the properties we found to be most important in units libraries, and advice on using them effectively. Because Au was designed from the ground up with these best practices in mind, it thoroughly exemplifies them. Check out the video below, and follow along with the slide deck if you like.

Chip Hogg's CppCon 2021 Aurora units talk

NOTE: This open-source version has been significantly improved from what was presented in the talk: both in its user interfaces, and under the hood! The one downside is that matrix and vector support hasn't yet been implemented. See #70 for more details, and subscribe to that issue to watch for progress.

au's People

Contributors

chiphogg avatar geoffviola avatar hoffbrinkle avatar matthew-reynolds avatar philsc avatar timhirsh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.