c++0x 系列
大致定義:
template<class Ty>
struct result_of {
typedef T0 type;
};
Ty: 可調用類型,
-
if Fty is a pointer to function type R(*)(U1, U2, ..., UN) the return type is R; -
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="431cb32562039bfd9017c5aa7dea77c9" mtps:Sentence>如果Fty是個R(*)(U1, U2, ..., UN) 函數指針,那么返回類型是R msdn2.microsoft.com mtps:Sentence>
-
if Fty is a reference to function type R(&)(U1, U2, ..., UN) the return type is R; -
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="92961a7fa98917045e0e4cf8af28a86b" mtps:Sentence>如果Fty是個R(&)(U1, U2, ..., UN) 函數指針,那么返回類型是R msdn2.microsoft.com mtps:Sentence>
-
if Fty is a pointer to member function type R(U1::*)(U2, ..., UN) the return type is R; - class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="fc99fda7f5220af73d97358cc2424041" mtps:Sentence>
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="92961a7fa98917045e0e4cf8af28a86b" mtps:Sentence>如果Fty是個R(U1::*)(U2, ..., UN)成員函數指針,那么返回類型是R msdn2.microsoft.com mtps:Sentence>
-
if Fty is a pointer to data member type R U1::* the return type is R; -
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="bc39f2474dd6f5737738d479e04f872d" mtps:Sentence>如果Fty是個R U1::* 成員變量指針,那么返回類型是R msdn2.microsoft.com mtps:Sentence> msdn2.microsoft.com mtps:Sentence>
-
if Fty is a class with a member typedef result_type the return type is Fty::result_type; -
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="e0bc005a6984bd4fa230f4759ae660ce" mtps:Sentence>如果Fty是一個類并且其中定義了result_type ,那么返回類型是Fty::result_type msdn2.microsoft.com mtps:Sentence>
-
if N is 0 (that is, Ty is of the form Fty()) the return type is void; -
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="797b1888b595eb0ce0e8fd824b2cc2e6" mtps:Sentence>如果Fty函數不帶有任何的參數,那么返回類型是void msdn2.microsoft.com mtps:Sentence>
-
if Fty is a class with a member template named result the return type is Fty::result<T1, T2, ..., TN>::type; -
class=tgtSentence msdn2.microsoft.com xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="197268c8ff6cd2fad5263486a6e0151b" mtps:Sentence>如果Fty是個類并且有個成員模板是result,那么返回類型是Fty::result<T1, T2, ..., TN>::type
-
in all other cases it is an error. -
/msdn2.microsoft.com/mtps:Sentence class=tgtSentence xmlns="http://msdn2.microsoft.com/mtps" runat="server" sentenceid="6e8d1a3ffb35d4959fe43654ecf52f10">其它情況就會出錯//msdn2.microsoft.com/mtps:Sentence>
posted on 2011-07-29 10:24 Robertxiao 閱讀(152) 評論(0) 編輯 收藏 引用 所屬分類: C++ Tech