Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / config / test / boost_no_typename_with_ctor.ipp
1 //  Copyright (C) 2008 N. Musatti
2 //  Use, modification and distribution are subject to the
3 //  Boost Software License, Version 1.0. (See accompanying file
4 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 //  See http://www.boost.org/libs/config for most recent version.
7
8 //  MACRO:         BOOST_NO_TYPENAME_WITH_CTOR
9 //  TITLE:         Use of typename keyword with constructors
10 //  DESCRIPTION:   If the compiler rejects the typename keyword when calling
11 //                 the constructor of a dependent type
12
13 namespace boost_no_typename_with_ctor {
14
15 struct A {};
16
17 template <typename T>
18 struct B {
19   typedef T type;
20 };
21
22 template <typename T>
23 typename T::type f() {
24   return typename T::type();
25 }
26
27 int test() {
28   A a = f<B<A> >();
29   (void)a;
30   return 0;
31 }
32
33 }
34