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 13namespace boost_no_cxx11_final { 14 15struct X final {}; 16 17struct abstract 18{ 19 virtual int f() = 0; 20}; 21 22struct derived : public abstract 23{ 24 virtual int f() final 25 { 26 return 0; 27 } 28}; 29 30int check(abstract* pa) 31{ 32 return pa->f(); 33} 34 35int test() 36{ 37 derived d; 38 return check(&d); 39} 40 41} 42