Compile Time assertions
From: Senthilvel Samatharman (me_at_somewhere.com)
Date: 03/31/04
- Next message: John Harrison: "Re: Compile Time assertions"
- Previous message: Leor Zolman: "Re: [OT] Re: Placement of {"
- Next in thread: John Harrison: "Re: Compile Time assertions"
- Reply: John Harrison: "Re: Compile Time assertions"
- Reply: Leor Zolman: "Re: Compile Time assertions"
- Reply: bartek: "Re: Compile Time assertions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Mar 2004 19:25:37 +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.
- Next message: John Harrison: "Re: Compile Time assertions"
- Previous message: Leor Zolman: "Re: [OT] Re: Placement of {"
- Next in thread: John Harrison: "Re: Compile Time assertions"
- Reply: John Harrison: "Re: Compile Time assertions"
- Reply: Leor Zolman: "Re: Compile Time assertions"
- Reply: bartek: "Re: Compile Time assertions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]