baramin: (Default)
baramin ([personal profile] baramin) wrote2013-09-12 01:01 pm

Невыносимая легкость бытия

You can take the address of a static member if (and only if) it has an out-of-class definition:

class AE {
    // ...
public:
    static const int c6 = 7;
    static const int c7 = 31;
};

const int AE::c7;    // definition

int f()
{
    const int* p1 = &AE::c6;    // error: c6 not an lvalue
    const int* p2 = &AE::c7;    // ok
    // ...
}

(с) http://www.stroustrup.com/bs_faq2.html