Skip to content

Commit

Permalink
pw_digital_io: [[nodiscard]] on as() conversion functions
Browse files Browse the repository at this point in the history
Also remove the "under construction" warning from the docs.

Change-Id: If198f8975287a7a2ffe8478f45067c43e5308b1b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/189815
Commit-Queue: Auto-Submit <[email protected]>
Reviewed-by: Ted Pudlik <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Feb 3, 2024
1 parent c5018fb commit a05ea16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions pw_digital_io/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
=============
pw_digital_io
=============
.. warning::
This module is under construction and may not be ready for use.

``pw_digital_io`` provides a set of interfaces for using General Purpose Input
and Output (GPIO) lines for simple Digital I/O. This module can either be used
directly by the application code or wrapped in a device driver for more complex
Expand Down
4 changes: 2 additions & 2 deletions pw_digital_io/public/pw_digital_io/internal/conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ class Conversions {
}

template <typename T, typename = Enabled<T>>
constexpr T& as() {
[[nodiscard]] constexpr T& as() {
return pw::internal::SiblingCast<T&, CommonBase>(static_cast<Self&>(*this));
}

template <typename T, typename = Enabled<T>>
constexpr const T& as() const {
[[nodiscard]] constexpr const T& as() const {
return static_cast<const T&>(
pw::internal::SiblingCast<const T&, CommonBase>(
static_cast<const Self&>(*this)));
Expand Down

0 comments on commit a05ea16

Please sign in to comment.