Boost logo

Boost Users :

From: John Maddock (john_maddock_at_[hidden])
Date: 2002-06-06 06:12:37


> I'm using MSVC6.0 with service-pack 6.0 installed. But I'm getting
> some
> weird problems.
>
> Consider the following simple program:
>
> ----------------------------------------------------
> struct q
> {
> int x;
> };
>
> int main()
> {
> int t;
> t = boost::is_POD< int >::value; // Ok, t = true;
> t = boost::is_POD< void >::value; // Ok?, t = true
> (is
> 'void' considered a POD?);
> t = boost::is_POD< q >::value; // Error, t =
> false
> }
> ----------------------------------------------------
>
> Unless my definition of a POD type is incorrect, I think that q is
> considered POD, right?
>
> Am I doing something wrong here, or is the combination boost and msvc
> fatal
> once again?

No, there is no way within the current language that is_POD can deduce that
q is a POD. Hopefully the next version of the standard will address this,
but until then about the only option is to provide a specialisation of
is_POD for known non-trivial POD types.

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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