Title
Should std::complex use unqualified transcendentals?
Status
nad
Section
[complex.transcendentals]
Submitter
Matt Austern

Created on 2003-11-05.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

If you instantiate std::complex for user-defined types, all bets are off.

Date: 2003-11-05.00:00:00

Operations like pow and exp on complex<T> are typically implemented in terms of operations like sin and cos on T. Should implementations write this as std::sin, or as plain unqualified sin?

The issue, of course, is whether we want to use argument-dependent lookup in the case where T is a user-defined type. This is similar to the issue of valarray transcendentals, as discussed in issue 226.

This issue differs from valarray transcendentals in two important ways. First, "the effect of instantiating the template complex for types other than float, double or long double is unspecified." ([complex.syn]) Second, the standard does not dictate implementation, so there is no guarantee that a particular real math function is used in the implementation of a particular complex function.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2647
2003-11-05 00:00:00admincreate