[exception][msvc-7.1] regression and use of member template friends

Hi, In its current state in trunk, boost/exception/exception.hpp is generating regressions with MSVC 7.1 as shown in: http://tinyurl.com/yckdxrc The problem has to do with some (correct) member template friends declarations that MSVC 7.1 is not able to handle. Lines 222 and ff. of boost/exception/exception.hpp read: #if defined(__MWERKS__) && __MWERKS__<=0x3207 public: #else private: template <class E> friend E const & exception_detail::set_info( E const &, throw_function const & ); [...] To solve the problem the nicest solution would be to replace this by: #if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) public: #else private: template <class E> friend E const & exception_detail::set_info( E const &, throw_function const & ); [...] But exception.hpp, presumably to speed up compilation times, does not include any other header, so seems like including <boost/config.hpp> just to get this macro could be unacceptable. If this is the case, I suggest that the code be changed so as to simply go public and omit the member template friend declarations altogether. Thank you, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

On Sun, Feb 21, 2010 at 10:39 AM, JOAQUIN M. LOPEZ MUÑOZ <joaquin@tid.es> wrote:
But exception.hpp, presumably to speed up compilation times, does not include any other header, so seems like including <boost/config.hpp> just to get this macro could be unacceptable.
Yes, in my opinion not acceptable because this header is included by boost/throw_exception.hpp, which in turn is typically included by any Boost library that throws.
If this is the case, I suggest that the code be changed so as to simply go public and omit the member template friend declarations altogether.
Going public might not be such a bad idea but I decided to just ifdef for MSVC 7.1. Other poorly-conforming compilers aren't compatible with Boost Exception anyway so this should be OK. Revision 59837 should be fine, thanks for reporting this regression. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
participants (2)
-
Emil Dotchevski
-
JOAQUIN M. LOPEZ MUÑOZ