• <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!
            97久久精品国产精品青草| 久久久久亚洲AV片无码下载蜜桃| 91精品国产综合久久久久久| 国产精品99久久免费观看| 日本精品久久久中文字幕| 成人午夜精品久久久久久久小说 | 久久精品aⅴ无码中文字字幕重口 久久精品a亚洲国产v高清不卡 | 色偷偷久久一区二区三区| 国产精品久久波多野结衣| 免费精品国产日韩热久久| 伊人久久精品无码av一区| 久久美女网站免费| 婷婷久久久亚洲欧洲日产国码AV | 伊人久久大香线蕉综合5g| 久久国产精品99国产精| 久久久人妻精品无码一区| 欧美亚洲色综久久精品国产| 久久精品一区二区三区中文字幕 | 久久国产亚洲高清观看| 久久精品国产精品亚洲艾草网美妙| 囯产极品美女高潮无套久久久 | 狠狠精品久久久无码中文字幕| 久久综合久久性久99毛片| 久久无码高潮喷水| 激情五月综合综合久久69| 久久精品国产99久久无毒不卡 | 无码精品久久一区二区三区| WWW婷婷AV久久久影片| 亚洲中文字幕无码久久综合网| 久久午夜综合久久| 久久99亚洲综合精品首页| 久久不射电影网| 国产精品岛国久久久久| 国产精品一久久香蕉国产线看观看| 久久精品人人做人人爽电影| 色婷婷久久综合中文久久一本| 日韩电影久久久被窝网| 亚洲伊人久久成综合人影院 | 久久亚洲精品成人无码网站| 国内精品久久久久影院网站| 国产农村妇女毛片精品久久|