Sqandr

Sqandr Sqandr C++ | Agile | Win

Niner since 2013

Comments

  • Stephan T. Lavavej: Core C++, 1 of n

    I'm with example from 3.4.1 Unqualified name lookup, using VS2012-update2.

    typedef int f; 
    namespace N 
    { 
      struct A 
      {
        friend void f( A & );
        operator int();
        void g( A a ) { int i = f( a ); } 
        // f is the typedef, not the friend function: equivalent to int(a)
      };
    }

    Compiler complains that [friend] function f() returns a void that cannot be assigned to int.  Thoughts?

    Thank you Mr. STL!