Boost logo

Boost Users :

From: Thomas S. Urban (scottu_at_[hidden])
Date: 2004-10-13 10:05:02


The BOOST_STATIC_ASSERT documentation indicates I can use it at template
class scope (private recommended) - the assert shouldn't get triggered
unless the class is instantiated. This seems to work ok with gcc-3.*
but not with the intel compiler (8.1).

// begin example program
#include "boost/static_assert.hpp"

template<class T> struct foo
{
        foo (int) { }
private:
        BOOST_STATIC_ASSERT (false);
};

template <> struct foo<int>
{
        foo (int i) { }
};

int main ()
{
        foo<int> f (7);
}
// end example program

I get the following error:

foo.cpp(8): error: incomplete type is not allowed
        BOOST_STATIC_ASSERT (false);
        ^

compilation aborted for foo.cpp (code 2)

Whether I provide the specialization for int or not, or whether I ever
use struct foo in main or not.

Is this a know issue? Do I have a build problem? I'm using boost
version 1.30.2.

Thanks
Scott


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net