• <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.¢% 閱讀(669) 評論(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!
            久久久中文字幕| 久久婷婷五月综合97色一本一本| 久久66热人妻偷产精品9| 青青草国产成人久久91网| 久久91精品综合国产首页| 手机看片久久高清国产日韩| 久久久久久无码Av成人影院| 久久99精品九九九久久婷婷| 无码人妻精品一区二区三区久久久 | 久久人人爽人人爽人人片AV不 | 久久99久久无码毛片一区二区| 中文成人久久久久影院免费观看| 亚洲欧洲久久av| 91久久成人免费| 亚洲精品美女久久久久99小说| 久久精品无码午夜福利理论片 | 99热热久久这里只有精品68| 青青热久久国产久精品 | 精品国产乱码久久久久久郑州公司| 国产69精品久久久久99| 精品午夜久久福利大片| 男女久久久国产一区二区三区| 噜噜噜色噜噜噜久久| 日本亚洲色大成网站WWW久久| 国产V亚洲V天堂无码久久久| 亚洲中文字幕无码久久综合网| 久久久久综合国产欧美一区二区| 久久成人影院精品777| av无码久久久久久不卡网站| 亚洲中文字幕无码久久综合网| 伊人久久五月天| 久久精品国产亚洲AV影院| 久久精品人妻中文系列| 久久精品久久久久观看99水蜜桃| 一本久久a久久精品综合香蕉| 久久99久久成人免费播放| 精品无码久久久久久久动漫| 久久久久国产| 国产精品久久久久久五月尺| 无码专区久久综合久中文字幕| 九九久久精品无码专区|