xref: /llvm-project/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp (revision 61f2b3ed2183d24252561f9b48007e6cde937ce4)
15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier 
95a83710eSEric Fiselier // <functional>
105a83710eSEric Fiselier 
115a83710eSEric Fiselier // template <class Fn, class T>
125a83710eSEric Fiselier //   binder2nd<Fn>
135a83710eSEric Fiselier //   bind2nd(const Fn& op, const T& x);
145a83710eSEric Fiselier 
15*61f2b3edSLouis Dionne // REQUIRES: c++03 || c++11 || c++14
16*61f2b3edSLouis Dionne // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
17a470a13aSLouis Dionne 
185a83710eSEric Fiselier #include <functional>
195a83710eSEric Fiselier #include <cassert>
205a83710eSEric Fiselier 
217fc6a556SMarshall Clow #include "test_macros.h"
225a83710eSEric Fiselier #include "../test_func.h"
235a83710eSEric Fiselier 
main(int,char **)242df59c50SJF Bastien int main(int, char**)
255a83710eSEric Fiselier {
265a83710eSEric Fiselier     assert(std::bind2nd(test_func(1), 5)(10) == 5.);
272df59c50SJF Bastien 
282df59c50SJF Bastien   return 0;
295a83710eSEric Fiselier }
30