• <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!
            亚洲午夜久久影院| 色老头网站久久网| 国产精品成人99久久久久| 久久久精品国产亚洲成人满18免费网站| 久久99精品久久久久久野外| 囯产精品久久久久久久久蜜桃| 九九99精品久久久久久| 久久久久久久91精品免费观看| 国产亚洲色婷婷久久99精品| 久久久久人妻精品一区三寸蜜桃 | 久久er国产精品免费观看2| 超级碰久久免费公开视频| 亚洲精品乱码久久久久久蜜桃图片| 精品久久久久香蕉网| 久久久一本精品99久久精品88| 国产999精品久久久久久| 久久精品中文字幕无码绿巨人| 青青热久久国产久精品| 狠狠久久综合伊人不卡| 热re99久久精品国产99热| 色偷偷偷久久伊人大杳蕉| 欧美大战日韩91综合一区婷婷久久青草 | 无码任你躁久久久久久| 久久精品亚洲男人的天堂| 99久久精品影院老鸭窝| 久久久亚洲欧洲日产国码aⅴ| 久久青青草视频| 久久国产三级无码一区二区| 日本精品久久久久中文字幕8| 久久精品亚洲中文字幕无码麻豆| 亚洲综合熟女久久久30p| 久久久久久亚洲精品影院| 久久午夜夜伦鲁鲁片免费无码影视| 久久久WWW成人免费精品| 久久精品国产精品亚洲艾草网美妙| 99久久99久久精品国产| 久久精品三级视频| 亚洲国产成人久久一区久久| 国产69精品久久久久APP下载| 免费精品久久天干天干| 无码人妻精品一区二区三区久久久|