I don't really understand the GET and SET functions inside of a function. The functions go like this:
Where do you send the variable for set? When was this added? It seems like a neat way to create functions in classes and not have to create a new get/set function for everything.Code:int somefunction() { Get { return variable; } set { variable = this; } }
I think you're describing Properties, but the syntax is a bit off. Instead of function someFunction, it'd be property someProperty.
The value in the set is implicit - it's what gets passed when you say object.someProperty = x; (x is the passed value).
It's cleaner than Java's getProperty, setProperty IMHO.
Yes... Java is cleaner than C++ in some cases. >>... <<...
You need these for properties, not functions. You have it wrong.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks