Opened 14 years ago

Closed 14 years ago

#2251 closed Bugs (invalid)

Bad comment, I think

Reported by: Dave Abrahams Owned by: Dave Abrahams
Milestone: Boost 1.37.0 Component: utility
Version: Boost 1.36.0 Severity: Problem
Keywords: Cc: niels_dekker, joseph.gauterin

Description

	// - swap_impl has a using-directive, rather than a using-declaration,
	// because some compilers (including MSVC 7.1, Borland 5.9.3, and
	// Intel 8.1) don't do argument-dependent lookup when it has a
	// using-declaration instead.

IIUC, this isn't because of a peculiarity of any compiler: the standard says that ADL operates on names brought in to associated namespaces through using-declarations, but not on those visible by using-directives. A using-declaration is a declaration, while a using-directive is not :-)

Change History (3)

comment:1 by niels_dekker, 14 years ago

Cc: niels_dekker added
Owner: changed from niels_dekker to Dave Abrahams

The quoted lines of comment are intended to provide an explanation to revision [47967], by Joseph Gauterin, following a suggestion by Steven Watanabe.

MSVC 7.1 and Borland didn't do ADL, when we still had a using-declaration (using std::swap), inside swap_impl. So Steven suggested to do a using-directive (using namespace std) instead: http://lists.boost.org/Archives/boost/2008/08/140589.php (suggestion a)

Now that we have a using-directive, ADL appears to be done whenever appropriate, even for those specific compilers. As confirmed by the test results of specialized_in_global and specialized_in_other, at http://www.boost.org/development/tests/trunk/developer/utility-swap_.html

So would it be okay to you to have the ticket resolved as "invalid"?

comment:2 by joseph.gauterin, 14 years ago

Cc: joseph.gauterin added

in reply to:  1 comment:3 by Dave Abrahams, 14 years ago

Resolution: invalid
Status: newclosed

Replying to niels_dekker:

So would it be okay to you to have the ticket resolved as "invalid"?

Yes, in fact I think I misread the comment. Sorry!

Note: See TracTickets for help on using tickets.