質問

What if i want to set breakpoint into constructor with condition if I == 10?

template < typename T, int I >
class C 
{
public:

    C<T, I>() { cout << I << endl; }
};
役に立ちましたか?

解決

If conditional break point does not work try

template < typename T, int I >
class C 
{
public:

    C() 
    {
       if(I == 10)
       {
*         int a= 0; //or try __debugbreak();
       }
       cout << I << endl;
    }
};

EDIT To break on specific class you may use std::is_same<T, U>::value(or boost analogue) in condition

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top