CrossFramework Library

XBase/Reference.hpp

説明を見る。
00001 
00006 #if defined(XBASE_INCLUDED_REFERENCE_HPP)
00007 #else
00008 #define XBASE_INCLUDED_REFERENCE_HPP
00009 
00010 //------------------------------------------------------------
00011 #include <XBase/RuntimeAssert.hpp>
00012 
00013 //------------------------------------------------------------
00014 namespace XBase {
00016 
00017 
00022     template< typename T >
00023     class Reference
00024     {
00025     public:
00026         Reference( T& aRef ) 
00027             : mPtr( &aRef )
00028         {
00029         }
00030 
00031         operator T& ()const
00032         {
00033             XBASE_POINTER_ASSERT( mPtr );
00034             return *mPtr; 
00035         }
00036 
00037     private:
00038         T* mPtr;
00039     };
00041 }
00042 //------------------------------------------------------------
00043 #endif
00044 // EOF
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義