-
April 4th, 2013, 10:19 AM
#1
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!
-
April 4th, 2013, 11:06 AM
#2
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
Victor Nijegorodov
-
April 4th, 2013, 12:32 PM
#3
Re: create my own property which passes parameters
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.
Best regards,
Igor
-
April 4th, 2013, 04:02 PM
#4
Re: create my own property which passes parameters
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.)
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|