Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-04-04 10:47:39

----- Original Message -----
From: "Beman Dawes" <bdawes_at_[hidden]>
To: <boost_at_[hidden]>; <boost_at_[hidden]>
Sent: Wednesday, April 04, 2001 9:44 AM
Subject: Re: [boost] Re: scoped_ptr: trivial dtor?

> At 08:16 AM 4/4/2001, David Abrahams wrote:
> >> It would apply to other smart pointers, too, wouldn't it? shared_ptr,
> >> auto_ptr, etc?
> >
> >Of course.
> What should the actual code to look like? My first try would was:
> BOOST_STATIC_ASSERT( boost::is_complete<T>::value );
> But boost/type_traits.hpp doesn't have an is_complete<T>. Has that ever
> been discussed?

I don't know if that would be an appropriate type trait. Despite the obvious
implication of the phrase "incomplete type", incompleteness isn't really a
property of the type but of the translation unit. Consider what it would
mean if the syntax above could work:

#include <boost/type_traits.hpp>
struct foo;
static const bool a = boost::is_complete<T>::value;
struct foo {};
static const bool b = boost::is_complete<T>::value;

since a != b, somebody somewhere is breaking the ODR!


Boost list run by bdawes at, gregod at, cpdaniel at, john at