create my own property which passes parameters
Hello,
Is it possible to create property which I can pass parameters? would you please give me an example or solution? here is what I would like to do:
__property double a = {read=getA("a"), write=setA("a")};
__property double b= {read=getB("c"), write=setB("c")};
double getA(char *a);
void setA(double value, char *a);
double getB(char *a);
void setB(double value, char*a);
Thank you!
Re: create my own property which passes parameters
__property keyword does not belong to the standard native C++.
It is something from the managed C++ world, so please ask it in some of the .NET or managed C++/CLI forum
Re: create my own property which passes parameters
Quote:
Originally Posted by
jwspring
__property double a = {read=getA("a"), write=setA("a")};
__property double b= {read=getB("c"), write=setB("c")};
Actually I do not match this syntax to any I'm aware of. It's definitely not managed C++ __property. Neither it's plain VC++ __declspec(property) extension. So I wonder whether it's C++ at all.
Re: create my own property which passes parameters
:ehh: Generally speaking, (IMO) if it takes parameters, it's not a property, rather a member function. (Some sort of exception to this is the default property, AKA indexer, in .NET, but that would definitely be off-topic here.)