Linked by Thom Holwerda on Mon 13th Aug 2007 17:57 UTC
Permalink for comment 263161
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
News
Linked by Thom Holwerda on 06/17/13 17:58 UTC
Linked by Thom Holwerda on 06/17/13 17:52 UTC
Linked by Thom Holwerda on 06/14/13 21:03 UTC
Linked by Thom Holwerda on 06/14/13 20:46 UTC
Linked by Thom Holwerda on 06/14/13 17:32 UTC
Linked by Thom Holwerda on 06/14/13 11:39 UTC
Linked by Thom Holwerda on 06/14/13 11:32 UTC
Linked by Thom Holwerda on 06/13/13 19:39 UTC
Linked by Thom Holwerda on 06/13/13 14:45 UTC
Linked by Thom Holwerda on 06/13/13 11:43 UTC
More News »
Sponsored Links



Member since:
2005-07-06
Not necessarily. Macros provide for a way to transform text into other text, what's bad is the usage of macros that some people do.
With macros you could do this, in C++:
synchronized(object)
{
// Atomic operations here
}
Just like in java, and it would be totally legal C++, provided the macro synchronized expanded to something like this:
#define synchronized(o) for((o).Lock(); (o).isLocked(); (o).unLock())
Where o would be an object of a class exposing the Lock/isLocked/unLock methods. If a class inherited from a, say, synchronizable class implementing those methods, you would be able to do
someclass::somemethod()
{
synchronized(*this)
{
// bla bla bla
}
}
Which would be the equivalent of a synchronized method in the Java language.
You can have range checking in C++, you just need to either implement it in a class of your own or use some of the already existing classes.
You can have managed memory handling in C++ as well.