Skip to content

Commit

Permalink
Add class template type deduction guides to avoid CTAD warning. (#8135)
Browse files Browse the repository at this point in the history
* Add class template type dedeuction guides to avoid CTAD warning.

* Formatting.
  • Loading branch information
Zalman Stern authored Mar 5, 2024
1 parent 05ae15a commit 10e07e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ struct PrintSpan {
: span(span) {
}
};
// Class template argument deduction (CTAD) guide to prevent warnings.
template<typename T>
PrintSpan(const T &) -> PrintSpan<T>;

template<typename StreamT, typename T>
inline StreamT &operator<<(StreamT &stream, const PrintSpan<T> &wrapper) {
Expand Down Expand Up @@ -108,6 +111,9 @@ struct PrintSpanLn {
: span(span) {
}
};
// Class template argument deduction (CTAD) guide to prevent warnings.
template<typename T>
PrintSpanLn(const T &) -> PrintSpanLn<T>;

template<typename StreamT, typename T>
inline StreamT &operator<<(StreamT &stream, const PrintSpanLn<T> &wrapper) {
Expand Down

0 comments on commit 10e07e6

Please sign in to comment.