equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 /* |
|
18 * It is known that this code not compiled by following compilers: |
|
19 * gcc 2.95.3 |
|
20 * gcc 3.3.3 |
|
21 * gcc 3.4.1 |
|
22 * |
|
23 * It is known that this code compiled by following compilers: |
|
24 * |
|
25 * MSVC 6 |
|
26 * MSVC 8 Beta |
|
27 */ |
|
28 |
|
29 /* |
|
30 * Indeed this code is wrong: 1. explicit template specialization |
|
31 * have to appear out-of-class; 2. specialized struct C have to |
|
32 * have function f. |
|
33 * |
|
34 */ |
|
35 |
|
36 struct A |
|
37 { |
|
38 private: |
|
39 struct B |
|
40 { |
|
41 template <typename T> |
|
42 static void f( T& ) {} |
|
43 |
|
44 template <bool V> |
|
45 struct C |
|
46 { |
|
47 template <typename T> |
|
48 static void f( T& ) {} |
|
49 }; |
|
50 |
|
51 template <> |
|
52 struct C<true> |
|
53 { |
|
54 }; |
|
55 }; |
|
56 }; |
|
57 |