Opened 19 years ago

Closed 18 years ago

#220 closed Bugs (Fixed)

Inconvinient macro name 'i' makes VisualAssist to confuse

Reported by: kodt Owned by: John Maddock
Milestone: Component: type_traits
Version: None Severity:
Keywords: Cc:

Description

Boost version 1.30.0
File: type_traits\detail\is_mem_fun_pointer_tester.hpp
Macro definition
#define i BOOST_PP_FRAME_ITERATION(1)
<bla-bla-bla>
#undef i

i is a common name of a variable.
VisualAssist found this macro definition and, in result,
* it paints all occurences of i as macro, instead as local 
variable
* it refers to a line of macro definition, instead of a 
definition of exact variable

Environment:
MS Visual Studio 6
Visual Assist 6

P.S.
I'm sorry if my English is too bad

Change History (4)

comment:1 by david_abrahams, 19 years ago

Logged In: YES 
user_id=52572

There's not much we can do about VisualAssist.  This is their 
bug, since "i" is subsequently un-defined a few lines later.

comment:2 by kodt, 19 years ago

Logged In: YES 
user_id=890789

Well, if it's a problem of VisualAssist (in fact, it's a problem of 
an end user), there is another inconvinience.
If one writes some code as follows:

#include <complex>
#define i std::complex<double>(0.0,1.0)

#include <boost/type_traits.hpp>
// here i is undefined
#include <iostream>

main()
{
  std::cout << i*i << std::endl; // expect -1
}

I believe, boost should be more careful with commonly used 
identifiers.

comment:3 by pavel_kuznetsov, 19 years ago

Logged In: YES 
user_id=230164

That's right, it's a bug in Visual Assist. On the other hand it 
should not take too many efforts to help VA changing the name 
of the variable in question to something considerably less 
frequently used.

comment:4 by John Maddock, 18 years ago

Status: assignedclosed
Logged In: YES 
user_id=14804

I've just committed some patches to cvs that fix this, "i"
is no longer used as a macro name inside the type_traits lib.

John Maddock.
Note: See TracTickets for help on using tickets.