template<typename Friend, typename FieldType>
class crazyconst
{
    struct identity { typedef Friend type; };
    FieldType value;
    friend class identity::type;
    FieldType& operator=(const FieldType& newValue) { return value = newValue; }
public:
    operator FieldType(void) const { return value; }
    FieldType operator()(void) const { return value; }
};

class A
{
public:
    crazyconst<A, int> x;

    void doStuff()
    {
        // Gettin' stuff done
        x = 5; // OK
    }
};

int main(int argc, char** argv)
{
    A a;
    int b = a.x;
    int c = a.x(); // also works
}