
Daniel James <daniel@calamity.org.uk> writes:
Hi,
The attached patch improves the type traits library on Digital Mars. Mostly it just selects the correct code to be used, the only new code is a new version of boost::is_convertible. Using '...' to overload the conversion check works really badly, so I experimented with different ways of trying to get it to select the right overload, and found one that mostly works. You can see it in the patch. Also, when using static cosnt values it can sometimes cause '_m_from' to get instantiated - causing a link error. To work round this, it uses enums.
With this patch applied there are still the following problems:
The compiler has trouble with const and volatile modifiers on voids and arrays in template variables. So it gets a lot of the tests involving these types wrong.
The compiler allows some conversions that it shouldn't. For example, it only warns about binding temporaries to non-const references, instead of causing an error. So, in these cases is_convertible is true. Would it be worth adding checks for these cases?
is_abstract doesn't work.
is_base_and_derived uses the 'broken' implementation, based on is_convertible.
The test tricky_is_enum_test fails to compile.
Doesn't Walter update DMC++ quite often? Would it be better to just report bugs to him and wait for the fixes? I have no major objection to the patches; I'm just slightly concerned about crufting up the codebase to add support for a previously unsupported compiler if it will happen without changes in a few weeks anyway. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com