• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運轉,開心的工作
            簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            pass variable-argument list

            Posted on 2013-05-18 10:45 S.l.e!ep.¢% 閱讀(661) 評論(0)  編輯 收藏 引用 所屬分類: C++

            Introduction

            I've been looking for solution of passing variable-argument list from my va-function to another one, like TRACE for example. All solutions I saw were about using special functions that take va_list as argument. But this is a un-straight way. Why couldn't I just pass "..." to next function? C++ syntax doesn't allow this. But C++ allows to extend itself. Let me introduce you new macros from va_ set:

            template<byte count>
            struct SVaPassNext{
                SVaPassNext<count-1> big;
                DWORD dw;
            };
            template<> struct SVaPassNext<0>{};
            //SVaPassNext - is generator of structure of any size at compile time.class CVaPassNext{
            public:
                SVaPassNext<50> svapassnext;
                CVaPassNext(va_list & args){
            		try{//to avoid access violation
            			memcpy(&svapassnext, args, sizeof(svapassnext));
            		} catch (...) {}
                }
            };
            #define va_pass(valist) CVaPassNext(valist).svapassnext#if 0 //using:void MyVA_Function(szFormat, ...){
                va_list args;
                va_start(args, szFormat);
                SomeOtherVA_Function(szFormat, va_pass(args));
                va_end(args);
            }
            #endif
            how this works:
            I just copy 50 * sizeof(DWORD) bytes of stack to my struct of this size and simply pass this struct as ... argument to next function. Compiler just copies my copy of local stack to next function stack. And that's all we need.

            Enjoy!
            日本精品久久久久中文字幕8| AA级片免费看视频久久| 97精品国产97久久久久久免费 | 久久精品一区二区三区AV| 99久久www免费人成精品| 国产亚洲色婷婷久久99精品| 久久久久亚洲AV片无码下载蜜桃| 青青草原综合久久大伊人导航 | 久久天天日天天操综合伊人av| 久久精品国产99久久无毒不卡| 亚洲中文字幕久久精品无码APP| 人妻无码αv中文字幕久久琪琪布 人妻无码精品久久亚瑟影视 | 久久精品人妻一区二区三区| 狠狠人妻久久久久久综合| 国产AⅤ精品一区二区三区久久| 色综合色天天久久婷婷基地| 久久久99精品成人片中文字幕| 久久久久黑人强伦姧人妻| 欧美久久一级内射wwwwww.| 久久亚洲精品无码aⅴ大香| 国产精品久久久久a影院| 色婷婷久久综合中文久久蜜桃av| 久久精品国产亚洲av麻豆小说 | 亚洲国产日韩欧美久久| 国产亚洲精品久久久久秋霞| 97久久香蕉国产线看观看| 精品综合久久久久久88小说 | 狠狠综合久久AV一区二区三区| 久久一日本道色综合久久| 青青青伊人色综合久久| 亚洲精品NV久久久久久久久久| 久久人人爽人人爽人人片AV高清| 国产成人久久精品激情| 久久久无码精品亚洲日韩软件| 伊人久久综合精品无码AV专区| 97超级碰碰碰碰久久久久| 国产aⅴ激情无码久久| 国产精品免费久久| 久久精品亚洲一区二区三区浴池| 久久国产精品免费一区二区三区| 色妞色综合久久夜夜|