[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 8ee9eaf 1/7: Don't name unused template param
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 8ee9eaf 1/7: Don't name unused template parameters |
Date: |
Sat, 16 Jan 2021 04:07:18 -0500 (EST) |
branch: master
commit 8ee9eaf524604021b60b15018ac698529b816d1f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Don't name unused template parameters
Making up names for unused template parameters serves no purpose, and
creates a potential for conflict--for example:
template<typename T> class foo
{
template<typename T> friend void bar();
^ shadows 'T'
template<typename U> friend void baz();
^ shadows 'U' if added later
template<typename> friend void bar();
^ can never shadow anything
---
any_member.hpp | 2 +-
fenv_lmi_x86.hpp | 2 +-
mc_enum.hpp | 2 +-
timer.hpp | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/any_member.hpp b/any_member.hpp
index c462a82..0bceddc 100644
--- a/any_member.hpp
+++ b/any_member.hpp
@@ -113,7 +113,7 @@ class holder final
{
// Friendship is extended to class any_member only to support its
// cast operations.
- template<typename T> friend class any_member;
+ template<typename> friend class any_member;
public:
holder(ClassType*, ValueType const&);
diff --git a/fenv_lmi_x86.hpp b/fenv_lmi_x86.hpp
index c74c41b..4267344 100644
--- a/fenv_lmi_x86.hpp
+++ b/fenv_lmi_x86.hpp
@@ -212,7 +212,7 @@ struct msvc_control_word_parameters
template<typename ControlWordType>
class control_word
{
- template<typename T> friend class control_word;
+ template<typename> friend class control_word;
friend int test_main(int, char*[]);
typedef typename ControlWordType::integer_type integer_type;
diff --git a/mc_enum.hpp b/mc_enum.hpp
index 760ae80..ef2fff5 100644
--- a/mc_enum.hpp
+++ b/mc_enum.hpp
@@ -95,7 +95,7 @@ class mc_enum final
static_assert(std::is_enum_v<T>);
friend class mc_enum_test;
- template<typename U> friend std::vector<std::string> const& all_strings();
+ template<typename> friend std::vector<std::string> const& all_strings();
public:
typedef T enum_type;
diff --git a/timer.hpp b/timer.hpp
index 35bab00..c6bb760 100644
--- a/timer.hpp
+++ b/timer.hpp
@@ -47,7 +47,7 @@ void lmi_sleep(int seconds);
class LMI_SO Timer
{
friend class TimerTest;
- template<typename F> friend class AliquotTimer;
+ template<typename> friend class AliquotTimer;
public:
Timer();
- [lmi-commits] [lmi] master updated (f4619be -> eb70cdc), Greg Chicares, 2021/01/16
- [lmi-commits] [lmi] master 400f752 2/7: Do away with unused return value #1, Greg Chicares, 2021/01/16
- [lmi-commits] [lmi] master a73a260 6/7: Do away with unused return value #5, Greg Chicares, 2021/01/16
- [lmi-commits] [lmi] master 997d4d0 5/7: Do away with unused return value #4, Greg Chicares, 2021/01/16
- [lmi-commits] [lmi] master 8ee9eaf 1/7: Don't name unused template parameters,
Greg Chicares <=
- [lmi-commits] [lmi] master 78d6d35 4/7: Do away with unused return value #3, Greg Chicares, 2021/01/16
- [lmi-commits] [lmi] master bad394a 3/7: Do away with unused return value #2, Greg Chicares, 2021/01/16
- [lmi-commits] [lmi] master eb70cdc 7/7: Prefer not to pass std::vector by value, Greg Chicares, 2021/01/16