Skip to Content
Embedded Programming with Modern C++ Cookbook
book

Embedded Programming with Modern C++ Cookbook

by Igor Viarheichyk
April 2020
Intermediate to advanced
412 pages
9h 58m
English
Packt Publishing
Content preview from Embedded Programming with Modern C++ Cookbook

There's more...

More information about the [[nodiscard]] attribute can be found on its reference page (https://en.cppreference.com/w/cpp/language/attributes/nodiscard). Starting from C++20, the nodiscard attribute can include a string literal, explaining why the value should not be discarded; for example, [[nodiscard("Check for write errors")]].

It is important to understand that compliance with safety guidelines does make your code safer, but does not guarantee it. In our implementation of TimeSaver2, we use the value returned by time, but we do not check whether it is valid. Instead, we write to the output file unconditionally. Similarly, if write returns a non-zero number, it can still write less data to the file than requested. Even if ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ System Programming Cookbook

C++ System Programming Cookbook

Onorato Vaticone
C++ Cookbook

C++ Cookbook

D. Ryan Stephens, Christopher Diggins, Jonathan Turkanis, Jeff Cogswell

Publisher Resources

ISBN: 9781838821043Supplemental Content