forked from boostorg/beast
Remove test framework's dependency on RTTI:
Allow unit tests to compile with rtti=off This struct is only used to make sure that there are no duplication of test suites. Move it to a concept that works with RTTI disabled. Signed-off-by: Ed Tanous <ed@tanous.net> close #2337
This commit is contained in:
1 parent
3fd090af3b
commit
071b905bc4
2 files changed
+7
-2
No files matched your search
@@ -13,6 +13,8 @@
|
||||
#include <boost/beast/_experimental/unit_test/suite_info.hpp>
|
||||
#include <boost/beast/_experimental/unit_test/detail/const_container.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type_index.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <typeindex>
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
@@ -28,7 +30,9 @@ class suite_list
|
||||
private:
|
||||
#ifndef NDEBUG
|
||||
std::unordered_set<std::string> names_;
|
||||
std::unordered_set<std::type_index> classes_;
|
||||
|
||||
using type_index = boost::typeindex::type_index;
|
||||
std::unordered_set<type_index, boost::hash<type_index>> classes_;
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -65,7 +69,7 @@ suite_list::insert(
|
||||
|
||||
{
|
||||
auto const result(classes_.insert(
|
||||
std::type_index(typeid(Suite))));
|
||||
boost::typeindex::type_id<Suite>()));
|
||||
BOOST_ASSERT(result.second); // Duplicate type
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user