D
Dave
#include <iostream>
using std::cout;
using std::endl;
// #define CAUSE_ERROR
namespace N
{
struct foo_t {};
void foo_func(foo_t) {cout << "Got here!" << endl;}
}
int main()
{
#ifdef CAUSE_ERROR
// EXPECTED ERROR - the parentheses surrounding the function name inhibit
// argument-dependent (Koenig) lookup, so the identifier foo_func will
not
// be found.
(foo_func)(N::foo_t());
#else
foo_func(N::foo_t()); // This call should and does compile fine.
// Here, the same call that generates an error above works fine. I would
// have expected an error here due to the suppression of Koenig lookup
(as
// above). Is this behavior Standard-compliant, or have I indeed found a
bug
// in my implementation (VC++ 7.1)???
(foo_func)(N::foo_t());
#endif
}
using std::cout;
using std::endl;
// #define CAUSE_ERROR
namespace N
{
struct foo_t {};
void foo_func(foo_t) {cout << "Got here!" << endl;}
}
int main()
{
#ifdef CAUSE_ERROR
// EXPECTED ERROR - the parentheses surrounding the function name inhibit
// argument-dependent (Koenig) lookup, so the identifier foo_func will
not
// be found.
(foo_func)(N::foo_t());
#else
foo_func(N::foo_t()); // This call should and does compile fine.
// Here, the same call that generates an error above works fine. I would
// have expected an error here due to the suppression of Koenig lookup
(as
// above). Is this behavior Standard-compliant, or have I indeed found a
bug
// in my implementation (VC++ 7.1)???
(foo_func)(N::foo_t());
#endif
}