Debian Codegraph @

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: c++03
10
11 // <functional>
12
13 // See https://llvm.org/PR20002
14
15 #include <functional>
16 #include <type_traits>
17
18 #include "test_macros.h"
19
20 using Fn = std::function<void()>;
21 struct S : public std::function<void()> { using function::function; };
22
23 int main(int, char**) {
24 S s( [](){} );
25 S f1( s );
26 #if TEST_STD_VER <= 14
27 S f2(std::allocator_arg, std::allocator<int>{}, s);
28 #endif
29
30 return 0;
31 }