equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2005-2008 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 the License "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: Generic type manipulation templates. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 4 % |
|
20 */ |
|
21 |
|
22 #ifndef _TYPEMANIP_H |
|
23 #define _TYPEMANIP_H |
|
24 |
|
25 //////////////////////////////////////////////////////////////////////////////// |
|
26 // class template Int2Type |
|
27 // Converts each integral constant into a unique type |
|
28 // Invocation: Int2Type<v> where v is a compile-time constant integral |
|
29 // Defines 'value', an enum that evaluates to v |
|
30 //////////////////////////////////////////////////////////////////////////////// |
|
31 |
|
32 template <TInt v> |
|
33 struct Int2Type |
|
34 { |
|
35 enum { value = v }; |
|
36 }; |
|
37 |
|
38 //////////////////////////////////////////////////////////////////////////////// |
|
39 // class template Type2Type |
|
40 // Converts each type into a unique, insipid type |
|
41 // Invocation Type2Type<T> where T is a type |
|
42 // Defines the type OriginalType which maps back to T |
|
43 //////////////////////////////////////////////////////////////////////////////// |
|
44 |
|
45 template <typename T> |
|
46 struct Type2Type |
|
47 { |
|
48 typedef T OriginalType; |
|
49 }; |
|
50 |
|
51 #endif // _TYPEMANIP_H |