Skip to content
Snippets Groups Projects
Commit 77caf53e authored by Jan Trávníček's avatar Jan Trávníček
Browse files

remove not needed code

parent 9fe88dc0
Branches
Tags
No related merge requests found
......@@ -54,52 +54,6 @@ namespace ext {
template < typename T, typename ... Ts >
struct is_in < T, T, Ts ... > : std::true_type { };
 
// ----------------------------------------------------------------------------------------------------
template < class Ref, class Type >
struct match_cv_ref_rec {
typedef Type type;
};
template < class Ref, class Type >
struct match_cv_ref_rec < const Ref, Type > {
typedef typename std::add_const < typename match_cv_ref_rec < Ref, Type >::type >::type type;
};
template < class Ref, class Type >
struct match_cv_ref_rec < Ref &, Type > {
typedef typename std::add_lvalue_reference < typename match_cv_ref_rec < Ref, Type >::type >::type type;
};
template < class Ref, class Type >
struct match_cv_ref_rec < Ref &&, Type > {
typedef typename std::add_rvalue_reference < typename match_cv_ref_rec < Ref, Type >::type >::type type;
};
template < class Ref, class Type >
struct match_cv_ref_rec < volatile Ref, Type > {
typedef typename std::add_volatile < typename match_cv_ref_rec < Ref, Type >::type >::type type;
};
template < class Ref, class Type >
struct match_cv_ref {
typedef typename match_cv_ref_rec < Ref, typename std::decay < Type >::type >::type type;
};
// ----------------------------------------------------------------------------------------------------
template < typename ... T >
struct all_same : std::false_type { };
template < >
struct all_same < > : std::true_type { };
template < typename T >
struct all_same < T > : std::true_type { };
template < typename T, typename ... Ts >
struct all_same < T, T, Ts ... > : all_same < T, Ts ... > { };
} /* namespace ext */
 
#endif /* __TYPE_TRAITS_HPP_ */
......@@ -13,10 +13,6 @@ void TypeTraitsTest::setUp() {
void TypeTraitsTest::tearDown() {
}
 
void TypeTraitsTest::testAccessPackElement() {
CPPUNIT_ASSERT( ( std::is_same< ext::get_type_pack_element < 0, int, double >::type, int >::value ) == true );
}
void TypeTraitsTest::testTypeInPack() {
CPPUNIT_ASSERT( ( ext::is_in< int, double, ext::set<int>, float, char, int, std::string >::value ) == true );
CPPUNIT_ASSERT( ( ext::is_in< long, double, ext::set<int>, float, char, int, std::string >::value ) == false );
......
......@@ -3,68 +3,16 @@
 
#include <cppunit/extensions/HelperMacros.h>
 
class TypeTraitsTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( TypeTraitsTest );
CPPUNIT_TEST( testAccessPackElement );
CPPUNIT_TEST( testTypeInPack );
CPPUNIT_TEST( testTypeNames );
CPPUNIT_TEST_SUITE_END();
public:
struct test {
int * holder;
test() {
//std::cout << "test()" << std::endl;
holder = new int();
}
test(test&& old) : holder(nullptr) {
//std::cout << "test(test&&)" << std::endl;
std::swap(holder,old.holder);
}
test(const test& old) {
//std::cout << "test(const test&)" << std::endl;
holder = new int(*old.holder);
}
~test()
{
//std::cout << "~test()" << std::endl;
delete holder;
}
bool operator<(const test& other) const {
return *(this->holder) < *(other.holder);
}
bool operator==(const test& other) const {
return *(this->holder) == *(other.holder);
}
int compare(const test& other) const {
return *(this->holder) - *(other.holder);
}
friend std::ostream& operator<<(std::ostream& out, const test& other) {
out << *(other.holder);
return out;
}
};
struct test2 {
int m_i;
test2(int i) : m_i(i) {}
};
class TypeTraitsTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE( TypeTraitsTest );
CPPUNIT_TEST( testTypeInPack );
CPPUNIT_TEST( testTypeNames );
CPPUNIT_TEST_SUITE_END();
 
public:
void setUp();
void tearDown();
 
void testAccessPackElement();
void testTypeInPack();
void testTypeNames();
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment