2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-30 08:02:38 +00:00

MSVC 6.5 ICE fix

[SVN r15325]
This commit is contained in:
Aleksey Gurtovoy
2002-09-15 02:42:47 +00:00
parent 3c9230c0e4
commit f6a85e2e04

View File

@@ -85,7 +85,15 @@ namespace detail
SelectHolder::register_();
}
template <class T> int assert_default_constructible(T const&);
template <class T>
struct assert_default_constructible
{
static int check2(T const&);
static int check()
{
return sizeof(check2(T()));
}
};
}
//
@@ -280,6 +288,7 @@ class class_ : public objects::class_base
// Define the default constructor.
self& def_init()
{
detail::assert_default_constructible<T>::check();
this->def_init(mpl::list0<>::type());
return *this;
}
@@ -419,7 +428,6 @@ inline class_<T,X1,X2,X3>::class_()
: base(typeid(T).name(), id_vector::size, id_vector().ids)
{
this->register_();
detail::force_instantiate(sizeof(detail::assert_default_constructible(T())));
this->def_init();
this->set_instance_size(holder_selector::additional_size());
}
@@ -437,7 +445,6 @@ inline class_<T,X1,X2,X3>::class_(char const* name, char const* doc)
: base(name, id_vector::size, id_vector().ids, doc)
{
this->register_();
detail::force_instantiate(sizeof(detail::assert_default_constructible(T())));
this->def_init();
this->set_instance_size(holder_selector::additional_size());
}