1 // (C) Copyright Beman Dawes 2008
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)
7 // See http://www.boost.org/libs/config for more information.
9 // MACRO: BOOST_NO_CXX11_CONSTEXPR
10 // TITLE: C++0x constexpr unavailable
11 // DESCRIPTION: The compiler does not support C++0x constexpr
13 namespace boost_no_cxx11_constexpr {
15 void quiet_warning(int){}
17 constexpr int square(int x) { return x * x; } // from N2235
20 constexpr const int* addr(const int& ir) { return &ir; }
21 static const int x = 5;
22 constexpr const int* xp = addr(x);
26 constexpr A(int i) : val(i) { }
27 constexpr operator int()const { return val; }
28 constexpr operator long()const { return 43; }
33 template<int> struct X { };
35 constexpr const A a = 42;
37 X<a> xx; // OK: unique conversion to int