Subject: [Boost-bugs] [Boost C++ Libraries] #4344: [helper1.cpp] Please consider a qualified call to boost::enable_error_info
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-06-14 21:03:40
#4344: [helper1.cpp] Please consider a qualified call to boost::enable_error_info
--------------------------+-------------------------------------------------
Reporter: niels_dekker | Owner: emildotchevski
Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: exception
Version: Boost 1.44.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
[https://svn.boost.org/trac/boost/browser/trunk/libs/exception/test/helper1.cpp?rev=52227
exception/test/helper1.cpp] has an unqualified call to enable_error_info:
{{{
throw enable_error_info( std::length_error("exception test length error")
);
}}}
Because the namespace is unspecified, the compiler has to look into the
global namespace, boost, boost::exception_test, and the namespace(s)
associated with its argument (ADL), in order to find the best match for
the enable_error_info function call.
Is the function enable_error_info really meant to be customizable that
way, by allowing to add an overload of enable_error_info to one of the
namespaces associated with its argument? Otherwise I think it's preferable
to do a qualified call to boost::enable_error_info:
{{{
throw boost::enable_error_info( std::length_error("exception test length
error") );
}}}
This little modification would also make it easier to get
enable_error_info_test compiling on Codegear. Your unqualified function
call triggers an internal compiler error, as I just reported to
Embarcadero: http://qc.embarcadero.com/wc/qcmain.aspx?d=85444
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4344> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC