Fixed a few more notes from Niall

This commit is contained in:
Antony Polukhin
2013-10-31 11:40:16 +04:00
parent 868328d2f6
commit 79fbd3ab5c
4 changed files with 12 additions and 9 deletions

View File

@@ -14,7 +14,7 @@
/// By inclusion of this file all classes (boost::type_info + boost::type_index if RTTI is on
/// and boost::template_info + boost::template_index) will be available.
///
/// Consider including <boost/type_index/type_index.hpp> if you do not whant to include
/// Consider including <boost/type_index/type_index.hpp> if you do not want to include
/// boost::template_info and boost::template_index class while RTTI is available.
///
/// Consider including <boost/type_index/type_info.hpp> if you need only boost::type_info class

View File

@@ -236,27 +236,27 @@ public:
}
bool operator == (const template_info& rhs) const BOOST_NOEXCEPT {
return !std::strcmp(name_, rhs.name());
return name_ == rhs.name() || !std::strcmp(name_, rhs.name());
}
bool operator != (const template_info& rhs) const BOOST_NOEXCEPT {
return !!std::strcmp(name_, rhs.name());
return name_ != rhs.name() && !!std::strcmp(name_, rhs.name());
}
bool operator < (const template_info& rhs) const BOOST_NOEXCEPT {
return std::strcmp(name_, rhs.name()) < 0;
return name_ != rhs.name() && std::strcmp(name_, rhs.name()) < 0;
}
bool operator > (const template_info& rhs) const BOOST_NOEXCEPT {
return std::strcmp(name_, rhs.name()) > 0;
return name_ != rhs.name() && std::strcmp(name_, rhs.name()) > 0;
}
bool operator <= (const template_info& rhs) const BOOST_NOEXCEPT {
return std::strcmp(name_, rhs.name()) <= 0;
return name_ == rhs.name() || std::strcmp(name_, rhs.name()) <= 0;
}
bool operator >= (const template_info& rhs) const BOOST_NOEXCEPT {
return std::strcmp(name_, rhs.name()) >= 0;
return name_ == rhs.name() || std::strcmp(name_, rhs.name()) >= 0;
}
/// Function for getting hash value

View File

@@ -184,7 +184,7 @@ public:
bool operator == (type_info const& rhs) const BOOST_NOEXCEPT {
#ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES
return !std::strcmp(name(), rhs.name());
return name() == rhs.name() || !std::strcmp(name(), rhs.name());
#else
return static_cast<const stl_type_info&>(*this) == static_cast<const stl_type_info&>(rhs);
#endif
@@ -207,7 +207,7 @@ public:
/// Works exactly like operator <
bool before(type_info const& rhs) const BOOST_NOEXCEPT {
#ifdef BOOST_CLASSINFO_COMPARE_BY_NAMES
return std::strcmp(name(), rhs.name()) < 0;
return name() != rhs.name() && std::strcmp(name(), rhs.name()) < 0;
#else
return stl_type_info::before(rhs);
#endif

View File

@@ -0,0 +1,3 @@
This patch requires additional care.
It works and tested through the Boost.Graph tests, but in some places `typeid(variable)` were replaced with `typeid(Type)`.