1// (C) Copyright Andrzej Krzemienski 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_REF_QUALIFIERS 10// TITLE: C++11 ref-qualifiers on member functions. 11// DESCRIPTION: The compiler does not support the C++11 ref-qualifiers on member functions as described in N2439. 12 13namespace boost_no_cxx11_ref_qualifiers { 14 15struct G 16{ 17 char get() & { return 'l'; } 18 char get() && { return 'r'; } 19 char get() const& { return 'c'; } 20}; 21 22int test() 23{ 24 G m; 25 const G c = G(); 26 27 if (m.get() != 'l') return 1; 28 if (c.get() != 'c') return 1; 29 if (G().get() != 'r') return 1; 30 return 0; 31} 32 33} 34