]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/config/test/boost_no_cxx11_final.ipp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / config / test / boost_no_cxx11_final.ipp
1 // (C) Copyright Agustin Berge 2014
2
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 // See http://www.boost.org/libs/config for more information.
8
9 // MACRO: BOOST_NO_CXX11_FINAL
10 // TITLE: C++11 final class-virt-specifier
11 // DESCRIPTION: The compiler does not support the C++ class-virt-specifier final
12
13 namespace boost_no_cxx11_final {
14
15 struct X final {};
16
17 struct abstract
18 {
19 virtual int f() = 0;
20 };
21
22 struct derived : public abstract
23 {
24 virtual int f() final
25 {
26 return 0;
27 }
28 };
29
30 int check(abstract* pa)
31 {
32 return pa->f();
33 }
34
35 int test()
36 {
37 derived d;
38 return check(&d);
39 }
40
41 }