From f6a85e2e049f59f9823850db91f931dfe4070a14 Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Sun, 15 Sep 2002 02:42:47 +0000 Subject: [PATCH] MSVC 6.5 ICE fix [SVN r15325] --- include/boost/python/class.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 6480b817..7f769739 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -85,7 +85,15 @@ namespace detail SelectHolder::register_(); } - template int assert_default_constructible(T const&); + template + 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::check(); this->def_init(mpl::list0<>::type()); return *this; } @@ -419,7 +428,6 @@ inline class_::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_::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()); }