[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9f42f53 2/5: Remove pleonastic is_same
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9f42f53 2/5: Remove pleonastic is_same |
Date: |
Tue, 10 Jan 2017 01:46:13 +0000 (UTC) |
branch: master
commit 9f42f53722ffb65b5a7e591a968c704a66c77251
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Remove pleonastic is_same
is_same implies is_base_of (for non-unions), so it's redundant to
assert both together.
---
any_member.hpp | 12 ++++--------
multidimgrid_safe.hpp | 5 +----
mvc_controller.tpp | 6 +-----
safely_dereference_as.hpp | 6 +-----
wx_utility.hpp | 6 +-----
5 files changed, 8 insertions(+), 27 deletions(-)
diff --git a/any_member.hpp b/any_member.hpp
index f41a73d..3b1b4e6 100644
--- a/any_member.hpp
+++ b/any_member.hpp
@@ -632,14 +632,10 @@ void MemberSymbolTable<ClassType>::ascribe
));
BOOST_STATIC_ASSERT
((
- std::is_same
- <SameOrBaseClassType
- ,ClassType
- >::value
- || std::is_base_of
- <SameOrBaseClassType
- ,ClassType
- >::value
+ std::is_base_of
+ <SameOrBaseClassType
+ ,ClassType
+ >::value
));
ClassType* class_object = static_cast<ClassType*>(this);
diff --git a/multidimgrid_safe.hpp b/multidimgrid_safe.hpp
index c955f6a..a0149cd 100644
--- a/multidimgrid_safe.hpp
+++ b/multidimgrid_safe.hpp
@@ -260,10 +260,7 @@ template<typename AdjustControl, typename BaseAxisType =
MultiDimAxisAny>
class MultiDimAdjustableAxis
:public BaseAxisType
{
- BOOST_STATIC_ASSERT(
- ( std::is_base_of<MultiDimAxisAny, BaseAxisType>::value
- || std::is_same <MultiDimAxisAny, BaseAxisType>::value
- ));
+ BOOST_STATIC_ASSERT((std::is_base_of<MultiDimAxisAny,
BaseAxisType>::value));
protected:
typedef AdjustControl AxisAdjustControl;
diff --git a/mvc_controller.tpp b/mvc_controller.tpp
index 6010d49..ef4a810 100644
--- a/mvc_controller.tpp
+++ b/mvc_controller.tpp
@@ -74,11 +74,7 @@ T& MvcController::WindowFromXrcName(char const* name) const
BOOST_STATIC_ASSERT(!std::is_pointer<T>::value);
// Double parentheses: don't parse comma as a macro parameter separator.
- BOOST_STATIC_ASSERT
- ((
- std::is_same <wxWindow,T>::value
- || std::is_base_of<wxWindow,T>::value
- ));
+ BOOST_STATIC_ASSERT((std::is_base_of<wxWindow,T>::value));
wxWindow* w = FindWindow(wxXmlResource::GetXRCID(name));
if(!w)
diff --git a/safely_dereference_as.hpp b/safely_dereference_as.hpp
index 5c63ae8..7c5e5f7 100644
--- a/safely_dereference_as.hpp
+++ b/safely_dereference_as.hpp
@@ -71,11 +71,7 @@ template<typename T, typename U>
T& safely_dereference_as(U* u)
{
// Double parentheses: don't parse comma as a macro parameter separator.
- BOOST_STATIC_ASSERT
- ((
- std::is_same <U,T>::value
- || std::is_base_of<U,T>::value
- ));
+ BOOST_STATIC_ASSERT((std::is_base_of<U,T>::value));
if(!u)
{
std::ostringstream oss;
diff --git a/wx_utility.hpp b/wx_utility.hpp
index 6a2e72a..2638cca 100644
--- a/wx_utility.hpp
+++ b/wx_utility.hpp
@@ -84,11 +84,7 @@ void Connect
BOOST_STATIC_ASSERT((std::is_same<void,Return>::value));
BOOST_STATIC_ASSERT((std::is_base_of<wxEvtHandler,Class>::value));
typedef typename std::remove_reference<Argument>::type argument_type;
- BOOST_STATIC_ASSERT
- ((
- std::is_same <wxEvent,argument_type>::value
- || std::is_base_of<wxEvent,argument_type>::value
- ));
+ BOOST_STATIC_ASSERT((std::is_base_of<wxEvent,argument_type>::value));
if(!object)
{