Simplied bind using __invoke. In the process, found and fixed a couple of bugs. C++11 only.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131667 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2011-05-19 19:41:47 +00:00
parent 57cff290a4
commit 0148a838d0
3 changed files with 37 additions and 26 deletions

View File

@@ -264,4 +264,5 @@ int main()
{
test_void_1();
test_int_1();
test_void_2();
}

View File

@@ -241,8 +241,26 @@ test_void_2()
}
}
int f_nested(int i)
{
return i+1;
}
int g_nested(int i)
{
return i*10;
}
void test_nested()
{
using namespace std::placeholders;
assert(std::bind(f_nested, std::bind(g_nested, _1))(3) == 31);
}
int main()
{
test_void_1();
test_int_1();
test_void_2();
test_nested();
}