??xml version="1.0" encoding="utf-8" standalone="yes"?>ս:C++博客 - սƵ2019|սع//www.pppqb.icu/aaxron/记录修行的印? zh-cnMon, 16 Sep 2019 00:15:19 GMTMon, 16 Sep 2019 00:15:19 GMT60Oracle分页 - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2019/08/15/216694.html天下天下Thu, 15 Aug 2019 08:32:00 GMT//www.pppqb.icu/aaxron/archive/2019/08/15/216694.html//www.pppqb.icu/aaxron/comments/216694.html//www.pppqb.icu/aaxron/archive/2019/08/15/216694.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/216694.html//www.pppqb.icu/aaxron/services/trackbacks/216694.html
Oracle分页

查询语句:
select * FROM A_WECHAT WHERE 1=1

查询记录L:
SELECT nvl(count(*),0as totalNum 
FROM (
    select * FROM A_WECHAT WHERE 1=1
where 1=1


分页:

 SELECT 
    * 
FROM 
    ( 
        SELECT 
            TIN.*, ROWNUM AS rowno 
        FROM 
            ( 
          select * FROM A_WECHAT WHERE 1=1 order by OPENID desc
            ) TIN 
        WHERE 
            ROWNUM <= 50     ) TOUT 
WHERE 
    TOUT.rowno >= 1 


天下 2019-08-15 16:32 发表评论
]]>
c#条g~译 - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2019/06/26/216462.html天下天下Wed, 26 Jun 2019 10:03:00 GMT//www.pppqb.icu/aaxron/archive/2019/06/26/216462.html//www.pppqb.icu/aaxron/comments/216462.html//www.pppqb.icu/aaxron/archive/2019/06/26/216462.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/216462.html//www.pppqb.icu/aaxron/services/trackbacks/216462.html Conditional compilation symbols
~译器命令行选项Q例如,/define:DEBUGQ?
    可以在VS2008的IDEq行讄, Project Property--->Build--->Conditional compilation symbols(如果多个U研使用逗号隔开)
    pȝ默认讄?DEBUG ?TRACE
操作pȝ外壳E序中的环境变量Q例如,set DEBUG=1Q?/div>
源代码中的杂注(例如Q用于定义编译变量的 #define DEBUGQ以及用于取消定义它?#undef DEBUGQ?/div>
     必须在file的最前方讄,#define debug或者组合操?/div>
    #if (Debug && Trace)
        #define DebugAndTrace 
    #endif
ps:Conditional位于using System.Diagnostics;
什么情况下使用该标识符?
当程序中一个方法或属性不惛_使用?如果把它删掉需要把引用的地方一个一个全部删掉不然就会编译错?q时我们可以在塔的上面加一个[Conditional("string")] 然后E序q行时就会忽略它
ps:[Conditional("string")]里面字符串随意取  
如果惛_ơ调用那个方法或属性怎么?
q个很简?你只需在引用命名空间那个地方进行一个宏定义把你在[Conditional("string")]里面的字W串定义出来p用了
C#-#define条g~译
C#的预处理器指令从来不会{化ؓ可执行代码的命oQ但是会影响~译q程的各个方面,常用的预处理器指令有#define?undef?if,#elif,#else?endif{等Q下面介lC#中?defineq行条g~译的实例?/div>
C#中条件编译指令用于按条g包含或排除源文g中的某些部分。在Visual Studio中,会看到被排除的代码显CZؓ灰色?/div>
一?define可以用来做什?/div>
1、当计划发布两个版本的代码的时候。即基本版和拥有更多版本的企业版Q就可以用到条g~译指oQ?/div>
2、例如同一个文件给silverlight、wpf、winform{用,q且q考虑Debug和Release{,有大部分代码是一LQ?/div>
3、指定函数和属性是否编译到最l品中厅R?/div>
二?define用法
语法Q?define 名称
注意Q这里名U取DebugQ你也可以取其他名称如Dragon
1 #define Debug
说明Q?/div>
1、Debug可以看做是声明的一个变量,但此变量没有真正的|存在?if Debugl果为trueQ否则ؓfalseQ?/div>
2?define单独用没什么意义,一般是?if或者ConditionalҎ结合用;
3?define必须定义在所有using命名I间前面Q?/div>
4、Debug与DEBUG是不同的QC#区分大小?/div>
 


天下 2019-06-26 18:03 发表评论
]]>spring 官方下蝲地址QSpring Framework 3.2.x&Spring Framework 4.0.xQ?/title><link>//www.pppqb.icu/aaxron/archive/2019/02/12/216238.html</link><dc:creator>天下</dc:creator><author>天下</author><pubDate>Tue, 12 Feb 2019 03:44:00 GMT</pubDate><guid>//www.pppqb.icu/aaxron/archive/2019/02/12/216238.html</guid><wfw:comment>//www.pppqb.icu/aaxron/comments/216238.html</wfw:comment><comments>//www.pppqb.icu/aaxron/archive/2019/02/12/216238.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/aaxron/comments/commentRss/216238.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/aaxron/services/trackbacks/216238.html</trackback:ping><description><![CDATA[<p>spring 官方下蝲地址QSpring Framework 3.2.x&Spring Framework 4.0.xQ?br />2017q?2?4?15:53:59 </p> <p>SPRING官方|站改版后,都是通过 Maven和Gradle下蝲Q对不用Maven和Gradle开发项目的Q下载就非常ȝQ下l出Spring Framework jar官方直接下蝲路径:</p> <p><a >//repo.spring.io/libs-release-local/org/springframework/spring/</a></p> <p> </p> <p>spring 4.0.x(Spring Framework 4.0.5)下蝲</p> <p><a >//repo.spring.io/libs-release-local/org/springframework/spring/4.0.5.RELEASE/spring-framework-4.0.5.RELEASE-dist.zip</a></p> <p> </p> <p>spring 3.2.xQSpring Framework 3.2.9Q下载:</p> <p><a >//repo.spring.io/libs-release-local/org/springframework/spring/3.2.9.RELEASE/spring-framework-3.2.9.RELEASE-dist.zip</a></p> <p> </p> <p> </p> <p>spring 3.2.xQSpring Framework 3.2.4Q下载:</p> <p><a >//repo.springsource.org/libs-release-local/org/springframework/spring/3.2.4.RELEASE/spring-framework-3.2.4.RELEASE-dist.zip</a></p> <p><br /> </p> <p>另spring security下蝲路径Q?/p> <p><a >//repo.spring.io/libs-release-local/org/springframework/security/spring-security/</a></p> <p><a >//repo.spring.io/libs-release-local/org/springframework/security/spring-security/3.2.4.RELEASE/spring-security-3.2.4.RELEASE-dist.zip</a></p><img src ="//www.pppqb.icu/aaxron/aggbug/216238.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/aaxron/" target="_blank">天下</a> 2019-02-12 11:44 <a href="//www.pppqb.icu/aaxron/archive/2019/02/12/216238.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>spring源码分析Q?QAnnotationMethodHandlerAdapter - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2018/04/11/215585.html天下天下Wed, 11 Apr 2018 08:40:00 GMT//www.pppqb.icu/aaxron/archive/2018/04/11/215585.html//www.pppqb.icu/aaxron/comments/215585.html//www.pppqb.icu/aaxron/archive/2018/04/11/215585.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/215585.html//www.pppqb.icu/aaxron/services/trackbacks/215585.htmlpublic class AnnotationMethodHandlerAdapter extends WebContentGenerator
        
implements HandlerAdapter, Ordered, BeanFactoryAware {
    
//

    
public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        
return invokeHandlerMethod(request, response, handler);
    }

    
protected ModelAndView invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        ServletHandlerMethodResolver methodResolver 
= getMethodResolver(handler);
        Method handlerMethod 
= methodResolver.resolveHandlerMethod(request);
        ServletHandlerMethodInvoker methodInvoker 
= new ServletHandlerMethodInvoker(methodResolver);
        ServletWebRequest webRequest 
= new ServletWebRequest(request, response);
        ExtendedModelMap implicitModel 
= new BindingAwareModelMap();

        Object result 
= methodInvoker.invokeHandlerMethod(handlerMethod, handler, webRequest, implicitModel);
        ModelAndView mav 
=
                methodInvoker.getModelAndView(handlerMethod, handler.getClass(), result, implicitModel, webRequest);
        methodInvoker.updateModelAttributes(handler, (mav 
!= null ? mav.getModel() : null), implicitModel, webRequest);
        
return mav;
    }

    
public ModelAndView getModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue,
            ExtendedModelMap implicitModel, ServletWebRequest webRequest) 
throws Exception {}
}


其他
public final class Method extends Executable {
    
public Object invoke(Object obj, Object args)
    
throws IllegalAccessException, IllegalArgumentException,InvocationTargetException
    {
        
if (!override) {
            
if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
                Class
<?> caller = Reflection.getCallerClass();
                checkAccess(caller, clazz, obj, modifiers);
            }
        }
        MethodAccessor ma 
= methodAccessor;             // read volatile
        if (ma == null) {
            ma 
= acquireMethodAccessor();
        }
        
return ma.invoke(obj, args);
    }
}
public class ModelMap extends LinkedHashMap<String, Object> {}

public abstract class AbstractView extends WebApplicationObjectSupport implements View, BeanNameAware {
    
/**
     * Prepares the view given the specified model, merging it with static
     * attributes and a RequestContext attribute, if necessary.
     * Delegates to renderMergedOutputModel for the actual rendering.
     * 
@see #renderMergedOutputModel
     
*/
    @Override
    
public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
        
if (logger.isTraceEnabled()) {
            logger.trace(
"Rendering view with name '" + this.beanName + "' with model " + model +
                
" and static attributes " + this.staticAttributes);
        }

        Map
<String, Object> mergedModel = createMergedOutputModel(model, request, response);
        prepareResponse(request, response);
        renderMergedOutputModel(mergedModel, getRequestToExpose(request), response);
    }
}
代码Q?br />

天下 2018-04-11 16:40 发表评论
]]>spring源码分析Q?QDispatcherServlet - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2018/04/11/215584.html天下天下Wed, 11 Apr 2018 08:39:00 GMT//www.pppqb.icu/aaxron/archive/2018/04/11/215584.html//www.pppqb.icu/aaxron/comments/215584.html//www.pppqb.icu/aaxron/archive/2018/04/11/215584.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/215584.html//www.pppqb.icu/aaxron/services/trackbacks/215584.htmlpublic class DispatcherServlet extends FrameworkServlet {
    
private List<HandlerMapping> handlerMappings;

    
protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
        doDispatch(request, response);
    }
    
    
protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpServletRequest processedRequest 
= request;
        HandlerExecutionChain mappedHandler 
= null;
        
boolean multipartRequestParsed = false;
        
try {
            ModelAndView mv 
= null;
            Exception dispatchException 
= null;
            
try {
                processedRequest 
= checkMultipart(request);
                multipartRequestParsed 
= (processedRequest != request);

                
// Determine handler for the current request.  //映射处理?/span>
                mappedHandler = getHandler(processedRequest); //HandlerExecutionChain
                if (mappedHandler == null || mappedHandler.getHandler() == null) {
                    noHandlerFound(processedRequest, response);
                    
return;
                }

                
// Determine handler adapter for the current request. //适配处理?/span>
                HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());

                
if (!mappedHandler.applyPreHandle(processedRequest, response)) {
                    
return;
                }

                
// Actually invoke the handler. 
                mv = ha.handle(processedRequest, response, mappedHandler.getHandler());

                applyDefaultViewName(processedRequest, mv); 
                mappedHandler.applyPostHandle(processedRequest, response, mv);
            }

            
//渲染视图
            processDispatchResult(processedRequest, response, mappedHandler, mv, dispatchException); 
        }
        
catch (Exception ex) {
            triggerAfterCompletion(processedRequest, response, mappedHandler, ex);
        }
        
finally {
        }
    }
    
private void processDispatchResult(HttpServletRequest request, HttpServletResponse response,
        HandlerExecutionChain mappedHandler, ModelAndView mv, Exception exception) 
throws Exception {
        
// Did the handler return a view to render?
        if (mv != null && !mv.wasCleared()) {
            render(mv, request, response);
        }
        
else {
            
if (logger.isDebugEnabled()) {
                logger.debug(
"Null ModelAndView returned to DispatcherServlet with name '" + getServletName() +
                        
"': assuming HandlerAdapter completed request handling");
            }
        }
        
if (mappedHandler != null) {
            mappedHandler.triggerAfterCompletion(request, response, 
null);
        }
    }
    
    
protected void render(ModelAndView mv, HttpServletRequest request, HttpServletResponse response) throws Exception {
        
// Determine locale for request and apply it to the response.
        Locale locale = this.localeResolver.resolveLocale(request);
        response.setLocale(locale);

        View view;
        
if (mv.isReference()) {
            
// We need to resolve the view name.
            view = resolveViewName(mv.getViewName(), mv.getModelInternal(), locale, request);
            
if (view == null) {
                
throw new ServletException("Could not resolve view with name '" + mv.getViewName() +
                        
"' in servlet with name '" + getServletName() + "'");
            }
        }
        
else {
            
// No need to lookup: the ModelAndView object contains the actual View object.
            view = mv.getView();
            
if (view == null) {
                
throw new ServletException("ModelAndView [" + mv + "] neither contains a view name nor a " +
                        
"View object in servlet with name '" + getServletName() + "'");
            }
        }

        
// Delegate to the View object for rendering.
        if (logger.isDebugEnabled()) {
            logger.debug(
"Rendering view [" + view + "] in DispatcherServlet with name '" + getServletName() + "'");
        }
        
try {
            view.render(mv.getModelInternal(), request, response);
        }
        
catch (Exception ex) {
            logger.debug(
"Error rendering view [" + view + "] in DispatcherServlet with name '" +    getServletName() + "'", ex);
            
throw ex;
        }
}


天下 2018-04-11 16:39 发表评论
]]>MoveWindow() SetWindowPos()的区别与联系 - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2017/05/17/214944.html天下天下Wed, 17 May 2017 10:56:00 GMT//www.pppqb.icu/aaxron/archive/2017/05/17/214944.html//www.pppqb.icu/aaxron/comments/214944.html//www.pppqb.icu/aaxron/archive/2017/05/17/214944.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/214944.html//www.pppqb.icu/aaxron/services/trackbacks/214944.htmlMoveWindow() SetWindowPos()的区别与联系
转自//www.cnblogs.com/songliquan/p/3359002.html

先看MoveWindow()函数Q用于改变窗口的位置和尺寸,对于层H口Q按照屏q对齐与左上角,对于子窗口,则对齐与父窗口的左上角?br />
BOOL MoveWindow( HWND hWnd,
int x, int y, int nWidth, int nHeight,BOOL bRepaint = TRUE);
参数hWnd表示H口句柄Q?br />参数x,y表示H口的左上角LQ?br />参数nwidthQnHeight 表示H口高度和宽度;
最后一个bRepaint表示是否立即重绘。ؓtrue时系l会立即发送WM_PAINT到窗口程序(会调用UpdateWindow()函数Q,为false时不会发生Q何类型的重绘操作?br />
MoveWindow会给H口发送WM_WINDOWPOSCHANGINGQWM_WINDOWPOSCHANGEDQWM_MOVEQWM_SIZE和WM_NCCALCSIZE消息?br />
接下来看SetWindowPos(),q个函数同样用来实现H口Ud操作Q只不过功能更多一炏V?br />
BOOL SetWindowPos(HWND hWnd,
const CWnd* pWndInsertAfter, int x, int y,int cx, int cy, UINT nFlags);
W一个参数是H口句柄Q?br />W二个参数是H口的Z orderQ就是有多个H口Ӟ本窗口显C的序Q最上面或者最下面Q可选参数有:HWND_BOTTOM,HWND_NOTOPMOST,HWND_TOP,HWND_TOPMOST.
HWND_BOTTOMQ将H口|于Z序的底部。如果参数hWnd标识了一个顶层窗口,则窗口失去顶U位|,q且被置在其他窗口的底部?nbsp;    
HWND_NOTOPMOSTQ将H口|于所有非层H口之上Q即在所有顶层窗口之后)。如果窗口已l是非顶层窗口则该标志不起作用?nbsp;    
HWND_TOP:窗口置于Z序的剙?nbsp;    
HWND_TOPMOST:窗口置于所有非层H口之上。即使窗口未被激zȝ口也保持顶U位|?nbsp;
接下来四个参数是H口的位|和寸?br />最后一个参数nFlags是窗口显C方式的标志Q这个参数很多,可以l合使用Q详l如下:
SWP_ASNCWINDOWPOSQ如果调用进E不拥有H口Q系l会向拥有窗口的U程发出需求。这防止调用线E在其他U程处理需求的时候发生死锁?nbsp;   
SWP_DEFERERASEQ防止生WM_SYNCPAINT消息?nbsp;   
SWP_DRAWFRAMEQ在H口周围M个边框(定义在窗口类描述中)?nbsp;   
SWP_FRAMECHANGEDQ给H口发送WM_NCCALCSIZE消息Q即使窗口尺寸没有改变也会发送该消息。如果未指定q个标志Q只有在改变了窗口尺寸时才发送WM_NCCALCSIZE?nbsp;
SWP_HIDEWINDOW;隐藏H口?nbsp;
SWP_NOACTIVATEQ不Ȁzȝ口。如果未讄标志Q则H口被激z,q被讄到其他最高H口或非最高l的剙Q根据参数hWndlnsertAfter讄Q?nbsp;
SWP_NOCOPYBITSQ清除客户区的所有内宏V如果未讄该标志,客户区的有效内容被保存ƈ且在H口寸更新和重定位后拷贝回客户区?nbsp;
SWP_NOMOVEQ维持当前位|(忽略X和Y参数Q?nbsp;   
SWP_NOOWNERZORDERQ不改变z序中的所有者窗口的位置?nbsp;
SWP_NOREDRAW:不重L变的内容。如果设|了q个标志Q则不发生Q何重d作。适用于客户区和非客户区(包括标题栏和滚动条)和Q何由于窗回移动而露出的父窗口的所有部分。如果设|了q个标志Q应用程序必L地使窗口无效ƈ重画H口的Q何部分和父窗口需要重ȝ部分?nbsp;
SWP_NOREPOSITIONQ与SWP_NOOWNERZORDER标志相同?nbsp;     SWP_NOSENDCHANGINGQ防止窗口接收WM_WINDOWPOSCHANGING消息?nbsp;
SWP_NOSIZEQ维持当前尺寸(忽略cx和Cy参数Q?nbsp;
SWP_NOZORDERQ维持当前Z序(忽略hWndlnsertAfter参数Q?nbsp;
SWP_SHOWWINDOWQ显C窗口?br />注意事项Q?br />使用SetWindowPos()如果讄了SWP_SHOWWINDOWS或者SWP_HIDEWINDOWQ那么窗口将不能被移动和改变大小Q我使用时就是设|了SWP_SHOWWINDOW,从而导致不能重l背景?br />
两者的比较Q?br />两者都能实现移动和改变H口大小?br />
MoveWindow()功能比较单一Q只能移动和改变H口大小Q而SetWindowPos()可以讄更多的参敎ͼ实现Zorder及显C方式标志?br />
MoveWindow()发送WM_WINDOWPOSCHANGINGQWM_WINDOWPOSCHANGEDQWM_MOVEQWM_SIZE和WM_NCCALCSIZE{消息到H口QSetWindowPos()只发送WM_WINDOWPOSCHANGED消息到窗口。所以说如果需要发送更多消息时q是使用MoveWindow()的好?/span>


天下 2017-05-17 18:56 发表评论
]]>Xtreme ToolKit 日志控g - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2017/05/16/214936.html天下天下Tue, 16 May 2017 03:06:00 GMT//www.pppqb.icu/aaxron/archive/2017/05/16/214936.html//www.pppqb.icu/aaxron/comments/214936.html//www.pppqb.icu/aaxron/archive/2017/05/16/214936.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/214936.html//www.pppqb.icu/aaxron/services/trackbacks/214936.html

/Files/aaxron/OppoTestX.rar

天下 2017-05-16 11:06 发表评论
]]>
MFC U程代码片段 - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2016/12/13/214480.html天下天下Tue, 13 Dec 2016 02:09:00 GMT//www.pppqb.icu/aaxron/archive/2016/12/13/214480.html//www.pppqb.icu/aaxron/comments/214480.html//www.pppqb.icu/aaxron/archive/2016/12/13/214480.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/214480.html//www.pppqb.icu/aaxron/services/trackbacks/214480.html貌似 挂vU程 必须在主界面的UIU程L?/p>
UINT UiThreadProcessProtocol(LPVOID lParam)
{
    CCalcPPIView
* view = (CCalcPPIView*)lParam;
    DmcControler
* Dmc = &(view->Dmc);

    
while (1)
    {
        
//AfxTrace("%u \n",GetTickCount());
        Sleep(500);
    } 
    
return 0;
}

CWinThread
* m_ThreadProcessProtocol;
m_ThreadProcessProtocol 
= AfxBeginThread(UiThreadProcessProtocol,this);

void CCalcPPIView::OnBtnRegulate()
{
    
if (m_ThreadProcessProtocol!=NULL) {
        m_ThreadProcessProtocol
->SuspendThread();
        AfxTrace(
"SuspendThread() at %u \n",GetTickCount());
    }
    
    {
        CRegulate dlg(
this);
        dlg.DoModal();
    }
    
if (m_ThreadProcessProtocol!=NULL) {
        m_ThreadProcessProtocol
->ResumeThread();
        AfxTrace(
"ResumeThread() at %u \n",GetTickCount());
    }
}

void CCalcPPIView::CloseDevice(BOOL bUpdateUI )
{
    CCalcPPIView
* view = this;
    AfxTrace(
"CCalcPPIView::CloseDevice() Entry \n");

    Dmc.SetOpened(
0);

    
if (view->m_ThreadProcessProtocol!=NULL) {
        WaitForSingleObject(view
->m_ThreadProcessProtocol->m_hThread,INFINITE);
        view
->m_ThreadProcessPro NULL;
    }
}

 

 



天下 2016-12-13 10:09 发表评论
]]>
VB Script - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2016/12/04/214460.html天下天下Sun, 04 Dec 2016 12:09:00 GMT//www.pppqb.icu/aaxron/archive/2016/12/04/214460.html//www.pppqb.icu/aaxron/comments/214460.html//www.pppqb.icu/aaxron/archive/2016/12/04/214460.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/214460.html//www.pppqb.icu/aaxron/services/trackbacks/214460.htmlOn Error Resume Next
set oshell = CreateObject("WScript.Shell")
oshell.run 
"//v.qq.com",0,false
WScript.quit


天下 2016-12-04 20:09 发表评论
]]>c++ traits(1) - սƵ2019|սع//www.pppqb.icu/aaxron/archive/2016/10/14/214333.html天下天下Fri, 14 Oct 2016 06:18:00 GMT//www.pppqb.icu/aaxron/archive/2016/10/14/214333.html//www.pppqb.icu/aaxron/comments/214333.html//www.pppqb.icu/aaxron/archive/2016/10/14/214333.html#Feedback0//www.pppqb.icu/aaxron/comments/commentRss/214333.html//www.pppqb.icu/aaxron/services/trackbacks/214333.html#pragma once
template 
<typename T>  
struct TraitsHelper;

template 
<typename T>  
struct TraitsHelper {  
    
static const bool isPointer = false;  
    
enum {IsPointer = false};
    
bool GetIsPointer()
    {
        
return IsPointer;
    }
};  
template 
<typename T>  
struct TraitsHelper<T*> {  
    
static const bool isPointer = true;  
    
enum {IsPointer = true};
    
bool GetIsPointer()
    {
        
return IsPointer;
    }
};  

//call
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
    
int val = 0;
    
int* pVal = &val;
    TraitsHelper
<int> a;
    TraitsHelper
<int*> b;

    
bool b1 = a.IsPointer;
    
bool b2 = b.IsPointer;

    
bool b3 = a.GetIsPointer();

    
bool b4 = TraitsHelper<int>::IsPointer;
    
bool b5 = TraitsHelper<int*>::IsPointer;


    
return 0;
}


սƵ2019 2016-10-14 14:18 发表评论
]]>