Opened 10 years ago

Closed 10 years ago

#8349 closed Bugs (wontfix)

using I as the name of a template parameter leads to compile errors

Reported by: Kevin Waugh <kevin.waugh@…> Owned by:
Milestone: To Be Determined Component: None
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

complex.h on my system #defines I to be the imaginary unit and leads to compile errors when some boost headers are included after it.

I've attached a patch renaming I to I in the headers which caused a problem for me.

Attachments (1)

I_to___I.patch (23.2 KB ) - added by Kevin Waugh <kevin.waugh@…> 10 years ago.

Download all attachments as: .zip

Change History (5)

by Kevin Waugh <kevin.waugh@…>, 10 years ago

Attachment: I_to___I.patch added

comment:1 by Steven Watanabe, 10 years ago

__I is a reserved identifier.

comment:2 by Steven Watanabe, 10 years ago

#undef I

No one has any business defining I as a macro.

in reply to:  2 comment:3 by Kevin Waugh <kevin.waugh@…>, 10 years ago

Replying to steven_watanabe:

#undef I

No one has any business defining I as a macro.

I agree that it's a pain that I is defined as a macro, but glibc does it and the solution to the compile errors (i.e., reordering the headers) was non-obvious.

comment:4 by Steven Watanabe, 10 years ago

Resolution: wontfix
Status: newclosed

complex.h is hopelessly broken.

#include <complex.h>
#include <complex>
Note: See TracTickets for help on using tickets.