Boost logo

Boost :

From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-01-20 13:03:11


On Sat, 15 Jan 2005 16:50:07 -0500
David Abrahams <dave_at_[hidden]> wrote:

> The way these things are handled is as follows: if another Boost
> library wants to use facilities that are an implementation detail of
> an existing Boost library, they are moved into boost/detail by the
> author of the former library. If someone wants to make the
> functionality available to users, that person moves it into namespace
> boost, documents it, and writes tests. Then the library goes through
> a fast-track review process.
>
> I'm happy to have either of those things happen to that code, but I'm
> not volunteering to do any of the work ;-)

OK, in some spare moments, I am making an attempt. However, I seem to
have run into many minor issues.

The first is that I can not reproduce your documented problems with
comparisons being wrong from shared libraries. My compiler triggers the
workaround. However, when I explicitly remove the workaround, my tests
still pass.

Do you have any tests that demonstrate this is broken behavior?

Here is what I have tried...

namespace shlibdetail
{
extern boost::type_info int_;
extern boost::type_info get_int_();
extern boost::type_info * get_int_ptr();
}

void test_shlib()
{
  boost::type_info int_ = boost::type_id<int>();
  BOOST_CHECK(int_ == shlibdetail::int_);
  BOOST_CHECK(int_ == shlibdetail::get_int_());
  BOOST_CHECK(int_ == *shlibdetail::get_int_ptr());
}

where the code for the shlib is...

#include "boost/type_id.hpp"

namespace shlibdetail
{

boost::type_info int_ = boost::type_id<int>();

boost::type_info get_int_()
{
  return boost::type_id<int>();
}

boost::type_info const * get_int_ptr()
{
  static boost::type_info * ptr;
  if (ptr == 0)
  {
    ptr = new boost::type_info(boost::type_id<int>());
  }
  return ptr;
}

} // end detail namespace


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk