• <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.¢% 閱讀(668) 評論(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!
            久久婷婷色综合一区二区| 伊人久久大香线蕉综合影院首页 | 久久综合久久综合久久| 色综合久久综合网观看| 一本色道久久88综合日韩精品 | 欧美亚洲国产精品久久| 无码伊人66久久大杳蕉网站谷歌| 久久精品草草草| 久久国产亚洲精品| 亚洲国产精品久久| 久久精品国产清自在天天线| 久久久九九有精品国产| 久久久久久精品免费看SSS| 伊人色综合久久天天| 久久久久亚洲AV无码专区首JN| 亚洲国产精品久久久久| 国内精品久久久久影院薰衣草 | 久久精品一区二区| 2021国内久久精品| 91精品婷婷国产综合久久| 色综合久久久久综合体桃花网| 久久久久亚洲av成人无码电影| 国产精品99精品久久免费| 久久人做人爽一区二区三区| 国产成人无码精品久久久免费| 久久精品国产亚洲AV无码偷窥| 超级97碰碰碰碰久久久久最新| 精品久久久久久国产免费了| 国产一级持黄大片99久久| 久久精品国产亚洲AV无码偷窥| 偷窥少妇久久久久久久久| 久久中文精品无码中文字幕| 久久AⅤ人妻少妇嫩草影院| 久久免费精品视频| 久久综合九色综合精品| 国产午夜精品理论片久久影视| 精品无码久久久久久尤物| 国产美女久久精品香蕉69| 久久精品人人做人人爽97| 色欲久久久天天天综合网| 国内精品九九久久精品|