mirror of
https://github.com/boostorg/python.git
synced 2026-01-20 04:42:28 +00:00
msvc6 (with STLPort) workaround
[SVN r15316]
This commit is contained in:
@@ -70,7 +70,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()));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
@@ -265,6 +273,7 @@ class class_ : public objects::class_base
|
||||
// Define the default constructor.
|
||||
self& def_init()
|
||||
{
|
||||
detail::assert_default_constructible<T>::check();
|
||||
this->def_init(mpl::type_list<>::type());
|
||||
return *this;
|
||||
}
|
||||
@@ -404,7 +413,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());
|
||||
}
|
||||
@@ -422,7 +430,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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user