How to initialize a static member of a parametrized-template class

前端 未结 2 642
感情败类
感情败类 2021-01-24 15:11

I don\'t think my question is dupplicate of this one.

what I try to do:

template
class CReentranceLock
{
public:
    CR         


        
相关标签:
2条回答
  • 2021-01-24 15:56
    bool CReentranceLock<const char*szFunctionName>::s_bLock=false; 
    

    This should be:

    bool CReentranceLock<szFunctionName>::s_bLock=false; 
    
    0 讨论(0)
  • 2021-01-24 16:07

    Just change the line to

    bool CReentranceLock<szFunctionName>::s_bLock=false;

    0 讨论(0)
提交回复
热议问题