
John Maddock ha escrito:
### mwcc Compiler: # In: ..\..\..\boost\type_traits\is_convertible.hpp # From: tricky_function_type_test.cpp # -------------------------------------- # 158: ); # Error: ^ # function call '_m_check({lval} void (), int)' does not match # 'boost::detail::is_convertible_basic_impl<void (&)(), boost::detail::int_convertible>::_m_check(boost::detail::any_conversion, ...)' (static) # 'boost::detail::is_convertible_basic_impl<void (&)(), boost::detail::int_convertible>::_m_check(boost::detail::int_convertible, int)' (static) # (point of instantiation: 'main()') # (instantiating: 'boost::is_enum<void ()>') # (instantiating:
I don't see any way around that unfortunately: the function call should be deduced to work OK: it does on EDG and gcc compilers, and ultimately all the possible implementations use either this method or the current one (or trivial variations). Is there any other way to work around the original problem?
I'm afraid there ain't. This popped up from original code like typename disable_if<is_convertible<const ChainedPtr,Type>,Type&>::type operator()(const ChainedPtr& x)const; which disables operator() when ChainedPtr satisfies the is_convertible condition --basically I cannot do anything to prevent the problem as ChainedPtr is a user-provided type. Excuse my beating this problem to death, but maybe there's still some hope: If I'm getting it right, Stefan's tests show that CW works with the EDG pp-branch technique EXCEPT when From is a function type. Cannot we do then the following? 1. If is_function<From>::value, use the current tecnhique. 2. Else, use the EDG tecnhique. The attached file implements this idea. I cannot test it myself under CW, it'd be great is someone can give it a try. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo