1
0
forked from boostorg/mp11

Rename make_from_tuple to construct_from_tuple

This commit is contained in:
Peter Dimov
2017-06-08 19:22:53 +03:00
parent 19865f6145
commit cae6f966dc
7 changed files with 46 additions and 44 deletions

View File

@@ -95,11 +95,11 @@ run integer_sequence.cpp : : : $(REQ) ;
# tuple
run tuple_for_each.cpp : : : $(REQ) ;
run tuple_for_each_cx.cpp : : : $(REQ) ;
compile tuple_for_each_cx.cpp : : : $(REQ) ;
run tuple_apply.cpp : : : $(REQ) ;
run tuple_apply_cx.cpp : : : $(REQ) ;
run make_from_tuple.cpp : : : $(REQ) ;
run make_from_tuple_cx.cpp : : : $(REQ) ;
compile tuple_apply_cx.cpp : : : $(REQ) ;
run construct_from_tuple.cpp : : : $(REQ) ;
compile construct_from_tuple_cx.cpp : : : $(REQ) ;
# set
run mp_set_contains.cpp : : : $(REQ) ;

View File

@@ -38,13 +38,13 @@ struct T2
int main()
{
using boost::mp11::make_from_tuple;
using boost::mp11::construct_from_tuple;
{
std::tuple<int, short, char> tp{ 1, 2, 3 };
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -52,7 +52,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -64,7 +64,7 @@ int main()
std::tuple<int, short, char> const tp{ 1, 2, 3 };
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -72,7 +72,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -86,7 +86,7 @@ int main()
{
std::tuple<std::unique_ptr<int>, std::unique_ptr<int>, std::unique_ptr<int>> tp{ std::unique_ptr<int>(new int(1)), std::unique_ptr<int>(new int(2)), std::unique_ptr<int>(new int(3)) };
T2 t2 = make_from_tuple<T2>( std::move(tp) );
T2 t2 = construct_from_tuple<T2>( std::move(tp) );
BOOST_TEST_EQ( *t2.x, 1 );
BOOST_TEST_EQ( *t2.y, 2 );
@@ -99,7 +99,7 @@ int main()
std::pair<int, short> tp{ 1, 2 };
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -107,7 +107,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -119,7 +119,7 @@ int main()
std::pair<int, short> const tp{ 1, 2 };
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -127,7 +127,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -139,7 +139,7 @@ int main()
std::array<int, 3> tp{{ 1, 2, 3 }};
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -147,7 +147,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -159,7 +159,7 @@ int main()
std::array<int, 3> const tp{{ 1, 2, 3 }};
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -167,7 +167,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 1 );
BOOST_TEST_EQ( t1.y, 2 );
@@ -179,7 +179,7 @@ int main()
std::tuple<> tp;
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 0 );
BOOST_TEST_EQ( t1.y, 0 );
@@ -187,7 +187,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 0 );
BOOST_TEST_EQ( t1.y, 0 );
@@ -199,7 +199,7 @@ int main()
std::array<int, 0> tp;
{
T1 t1 = make_from_tuple<T1>( tp );
T1 t1 = construct_from_tuple<T1>( tp );
BOOST_TEST_EQ( t1.x, 0 );
BOOST_TEST_EQ( t1.y, 0 );
@@ -207,7 +207,7 @@ int main()
}
{
T1 t1 = make_from_tuple<T1>( std::move(tp) );
T1 t1 = construct_from_tuple<T1>( std::move(tp) );
BOOST_TEST_EQ( t1.x, 0 );
BOOST_TEST_EQ( t1.y, 0 );

View File

@@ -30,12 +30,12 @@ struct T1
int main()
{
using boost::mp11::make_from_tuple;
using boost::mp11::construct_from_tuple;
{
constexpr std::tuple<int, short, char> tp{ 1, 2, 3 };
constexpr auto r = make_from_tuple<T1>( tp );
constexpr auto r = construct_from_tuple<T1>( tp );
static_assert( r.x == 1, "r.x == 1" );
static_assert( r.y == 2, "r.y == 2" );
@@ -45,7 +45,7 @@ int main()
{
constexpr std::pair<short, char> tp{ 1, 2 };
constexpr auto r = make_from_tuple<T1>( tp );
constexpr auto r = construct_from_tuple<T1>( tp );
static_assert( r.x == 1, "r.x == 1" );
static_assert( r.y == 2, "r.y == 2" );
@@ -55,7 +55,7 @@ int main()
{
constexpr std::array<short, 3> tp{{ 1, 2, 3 }};
constexpr auto r = make_from_tuple<T1>( tp );
constexpr auto r = construct_from_tuple<T1>( tp );
static_assert( r.x == 1, "r.x == 1" );
static_assert( r.y == 2, "r.y == 2" );
@@ -69,7 +69,7 @@ int main()
{
constexpr std::tuple<> tp;
constexpr auto r = make_from_tuple<T1>( tp );
constexpr auto r = construct_from_tuple<T1>( tp );
static_assert( r.x == 0, "r.x == 0" );
static_assert( r.y == 0, "r.y == 0" );