This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] std:: qualification in the include/std dir


Paolo Carlini <pcarlini@unitus.it> writes:

| Gabriel Dos Reis wrote:
| 
| >Paolo Carlini <pcarlini@unitus.it> writes:
| >
| >| Hi,
| > | | the below, tested x86-linux, completes the include/std dir.
| >
| >Paolo, the math bits are slighlty different (including valarray<>).
| >The math component realies on argument dependent name lookup to work
| >correctly.  Or else, it would be useless for most cases.
| >
| Could you possibly explain this in little more detail? I do not
| understand which other namespaces are relevant besides std::!

The issue is more sensitive for std::valarray (but it does also apply
to std::complex).  

The point is that the std::complex template is an example of algebraic
data structure built on top of its type parameter:  The
functionalities it provides are constructed from those of the type
parameter.  If you qualify the functionalities, then you suppress any
means by which user defined types could provide interfaces required to
make the whole thing work.  std:: qualification defeats the Interface
Principle.  

| Of course, I'm going to prepare the fix anyway: all the functions
| belonging to <cmath> must not be qualified, right?

Mostly yes.  Notable exceptions are abs() applied to a complex<_Up>.

| Anything else?

No.

Thank you!

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]