Q:

Give Access to a Pointer's Data Without Revealing Pointer Address

I have a class that contains a pointer. I want to keep the user of the class from accessing the address of the pointer (so they can't set it to another address, delete it, or what-not). However, I would like the user to be able to modify the pointer data (or member data if it's not POD) as well as call the pointer's methods (assuming it has any). 
Is there any way of returning a pointer or reference that allows you to change the data that a pointer points to without being able to change the pointer value itself?
So:
class A
{
public:
    int Value;
    void Method();
};

class Wrapper
{
public:
    Wrapper()
    {
        Pointer = new A;
    }
    // Method that somehow would give access to the object without 
    // Allowing the caller to access the actual address
    A* GetPointer()
    {
        return Pointer;
    }

private:
    A* Pointer;
};

int main()
{
    Wrapper foo;

    foo.GetPointer()->Value = 12; // Allowed
    foo.GetPointer()->Method();   // Allowed
    A* ptr = foo.GetPointer();    // NOT Allowed
    delete foo.GetPointer();      // NOT Allowed

    return 0;
}

I realize I could modify member data with getters and setters, but I'm not sure what to do about the methods (pass a method pointer maybe?) and I'd like to know if there is a better way before I accept a solution that I personally think looks messy.

A:

It's not possible. The whole reason why ->Value is legal is because the expression to the left is a (smart) pointer to A*.
Obviously, with a non-smart pointer you already have your A* right there. Since raw pointers are not user-defined types, you cannot mess with the overload resolution.
With a smart pointer, (*ptr).Value has to work. That means you have to return a A& from operator* which in turn means that &(*ptr) gets you the traw pointer from a smart pointer.
There's even std::addressof for classes that try to block operator&.

