• <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!
            99久久久国产精品免费无卡顿| 久久久久四虎国产精品| 国内精品久久久久久99| 久久精品国产99国产精品导航| 久久国产视频网| 久久亚洲色一区二区三区| 久久久久噜噜噜亚洲熟女综合| 久久国产精品二国产精品| 久久噜噜久久久精品66| 精品久久久久久中文字幕大豆网| 中文字幕无码免费久久| 久久精品国产一区二区三区日韩| 国产精品女同久久久久电影院| 久久精品天天中文字幕人妻| 国产亚洲色婷婷久久99精品91| 久久国产精品免费一区| 久久99精品国产一区二区三区| 久久国产免费| 久久久久中文字幕| 99国产欧美精品久久久蜜芽| 亚洲精品国精品久久99热一| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 久久99精品久久久久久水蜜桃| 日韩十八禁一区二区久久| 日本免费久久久久久久网站| 久久精品午夜一区二区福利| 99久久综合国产精品免费| 怡红院日本一道日本久久 | 国产亚州精品女人久久久久久 | 人妻无码久久精品| 伊人久久大香线蕉综合5g| 一本久久a久久精品亚洲| 久久精品人人做人人爽97| 久久久久久久久久久久中文字幕| 精品无码久久久久久尤物| 亚洲国产成人久久综合一 | 欧美一区二区久久精品| 伊人久久久AV老熟妇色| 国产精品久久久久无码av| 久久伊人五月天论坛| 青草影院天堂男人久久|