manison
manison

Reputation: 659

Different access modifiers for property getter/setter in C++/CLI

Is it possible to specify different access modifiers for property getter and setter using C++/CLI syntax? In C# one would write:

class Foo
{
    public string Bar
    {
        get;
        internal set;
    }
}

Upvotes: 14

Views: 6847

Answers (1)

user703016
user703016

Reputation: 37955

This should do:

public:
    property String^ Bar
    {
        String^ get();
    private:
        void set(String^);
    }

(Edited following Hans Passant's comment).

Upvotes: 22

Related Questions