From 5a83710e371fe68a06e6e3876c6a2c8b820a8976 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 20 Dec 2014 01:40:03 +0000 Subject: Move test into test/std subdirectory. llvm-svn: 224658 --- .../bind/func.bind/func.bind.bind/nested.pass.cpp | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp (limited to 'libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp') diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp new file mode 100644 index 00000000000..12720f7b550 --- /dev/null +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp @@ -0,0 +1,51 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// unspecified bind(Fn, Types...); +// template +// unspecified bind(Fn, Types...); + +// http://llvm.org/bugs/show_bug.cgi?id=16343 + +#include +#include +#include + +struct power +{ + template + T + operator()(T a, T b) + { + return std::pow(a, b); + } +}; + +struct plus_one +{ + template + T + operator()(T a) + { + return a + 1; + } +}; + +int +main() +{ + using std::placeholders::_1; + + auto g = std::bind(power(), 2, _1); + assert(g(5) == 32); + assert(std::bind(plus_one(), g)(5) == 33); +} -- cgit v1.2.3