lowlevellibsandfws/genericusabilitylib/inc/issame.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef ISSAME_H
       
    18 #define ISSAME_H
       
    19 
       
    20 
       
    21 // Provisional implementation of a construct that allows to determine
       
    22 // at compile time whether a type is the same as another type
       
    23 
       
    24 // To be redefined using std::tr1:is_same when a TR1 implementation
       
    25 // becomes available for use with Symbian OS.
       
    26 
       
    27 
       
    28 // Implementation construct - do not use
       
    29 template<typename T, typename U>
       
    30 struct TIsSame
       
    31 	{
       
    32 	enum
       
    33 	{
       
    34 		EValue = 0
       
    35 	};
       
    36 	};
       
    37 
       
    38 // Implementation construct - do not use
       
    39 template<typename T>
       
    40 struct TIsSame<T, T>
       
    41 	{
       
    42 	enum
       
    43 	{
       
    44 		EValue = 1
       
    45 	};
       
    46 	};
       
    47 
       
    48 
       
    49 #define IS_SAME(Type1, Type2) TIsSame<Type1, Type2>::EValue
       
    50 
       
    51 
       
    52 #endif //! ISSAME_H
       
    53