Compile Time assertions

From: Senthilvel Samatharman (me_at_somewhere.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 19:21:16 +0530

Hi,
I was reading a topic on Compile time assertions in "Modern C++ Design"
And i was unable to figure out how to use the technique described.

I know this is a lil stupid.. but i tried and i get a error

"e:\programs\test\test.cpp(10) : error C2514: 'CTAssert< ?? >' : class has
no constructors"

when i tried to compile the following program..
#include<iostream>

template <bool> class CTAssert;

template <> class CTAssert<true>{};

int main()
{
        const char* const pszData = "Hello World";
        CTAssert<pszData != 0> ( );
        return 0;
}

Can someone point me where i am going wrong?

Thanks and Best Regards,

Senthilvel.