mirror of
https://github.com/ETLCPP/etl.git
synced 2026-10-28 18:07:10 +08:00
Remove redundant functions
This commit is contained in:
parent
b88c088bd6
commit
b76e9ba553
@ -346,16 +346,6 @@ namespace etl
|
||||
{
|
||||
return p.first;
|
||||
}
|
||||
|
||||
#if ETL_CPP11_SUPPORTED
|
||||
//***************************************************************************
|
||||
///\copydoc operator()(TPair&)const
|
||||
//***************************************************************************
|
||||
type&& operator()(TPair&& p) const
|
||||
{
|
||||
return etl::move(p.first);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -391,16 +381,6 @@ namespace etl
|
||||
{
|
||||
return p.second;
|
||||
}
|
||||
|
||||
#if ETL_CPP11_SUPPORTED
|
||||
//***************************************************************************
|
||||
///\copydoc operator()(TPair&)const
|
||||
//***************************************************************************
|
||||
type&& operator()(TPair&& p) const
|
||||
{
|
||||
return etl::move(p.second);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
#if ETL_NOT_USING_STL || ETL_CPP14_NOT_SUPPORTED
|
||||
|
||||
@ -349,20 +349,6 @@ namespace
|
||||
CHECK_EQUAL(2, selector(sp2));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_select1st_move)
|
||||
{
|
||||
typedef etl::pair<int, std::string> EtlPair;
|
||||
typedef std::pair<int, std::string> StdPair;
|
||||
|
||||
auto selector = etl::select1st<EtlPair>();
|
||||
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
CHECK_EQUAL(1, selector(std::move(EtlPair(1, "Hello"))));
|
||||
CHECK_EQUAL(2, selector(std::move(StdPair(2, "Hello"))));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_select1st_example)
|
||||
{
|
||||
@ -399,23 +385,6 @@ namespace
|
||||
CHECK_EQUAL(std::string("World"), selector(sp2));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_select2nd_move)
|
||||
{
|
||||
typedef etl::pair<int, std::string> EtlPair;
|
||||
typedef std::pair<int, std::string> StdPair;
|
||||
|
||||
EtlPair ep1(1, "Hello");
|
||||
StdPair sp2(2, "World");
|
||||
|
||||
auto selector = etl::select2nd<EtlPair>();
|
||||
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
CHECK_EQUAL(std::string("Hello"), selector(std::move(EtlPair(1, "Hello"))));
|
||||
CHECK_EQUAL(std::string("World"), selector(std::move(StdPair(1, "World"))));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_select2nd_example)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user