lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 269f9c9 3/3: Reimplement stifle_unused_warnin


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 269f9c9 3/3: Reimplement stifle_unused_warning using a universal reference
Date: Thu, 28 Oct 2021 12:15:47 -0400 (EDT)

branch: master
commit 269f9c90c164df8ec4538696f021dc8196bac3ab
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Reimplement stifle_unused_warning using a universal reference
---
 miscellany.hpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/miscellany.hpp b/miscellany.hpp
index 3db0106..83a9d5c 100644
--- a/miscellany.hpp
+++ b/miscellany.hpp
@@ -291,9 +291,12 @@ inline unsigned char lmi_toupper(unsigned char c)
 }
 
 /// Avoid compiler warning for unused variable or unused value.
+///
+/// Rationale for this universal-reference implementation:
+///   https://lists.nongnu.org/archive/html/lmi/2021-10/msg00050.html
 
 template<typename T>
-constexpr void stifle_unused_warning(T const&)
+constexpr void stifle_unused_warning(T&&)
 {}
 
 #endif // miscellany_hpp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]