Article ID: 177431
Article Last Modified on 10/24/2003
/*
* Compiler Options: /GX
*/
#include <algorithm>
#include <functional>
#include <iostream>
#define BUG
//Workaround: Comment the line above.
//Uncomment the line below.
//#define WORKAROUND
#ifdef WORKAROUND
using namespace std ;
#endif
int main()
{
#ifdef BUG
std::binder2nd< std::multiplies<int> >
times_two(std::multiplies<int>(), 2);
#endif
#ifdef WORKAROUND
binder2nd< multiplies<int> > times_two(multiplies<int>(), 2);
#endif
int n = times_two(4) ;
std::cout << "n = " << n << std::endl ;
return 0 ;
}
/*
* Compiler Options: /GX
*/
#include <algorithm>
#include <functional>
#include <iostream>
#define BUG
//Workaround: Comment the line above.
//Uncomment the line below.
//#define WORKAROUND
int main()
{
#ifdef BUG
std::binder2nd< std::multiplies<int> >
times_two(std::multiplies<int>(), 2);
#endif
#ifdef WORKAROUND
std::multiplies<int> mi ;
std::binder2nd< std::multiplies<int> > times_two(mi, 2);
#endif
int n = times_two(4) ;
std::cout << "n = " << n << std::endl ;
return 0 ;
}
Keywords: kbbug kbfix kbvc600fix KB177431