Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Hopefully fixed "Writes to freed blocks" bug in ide - and warning (quiz)
Re: Hopefully fixed "Writes to freed blocks" bug in ide - and warning (quiz) [message #12297 is a reply to message #12293] Tue, 23 October 2007 21:47 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1308
Registered: September 2007
Ultimate Contributor
luzr wrote on Tue, 23 October 2007 19:45


Well, I think At is extremely effective way how to solve many problems. And similar issue existis even in the plain C

a[i++] = a[i];

it is simply something you have to care about...


Well, in your example, you can see that you're doing it wrong.
In theide bug, you can't.... or, at least, you can't if you don't know upp vector internals, what's normally the matter.
Usually people see Vector<> as a blackbox, they don't know (at least, I didn't know) about invalid references caused by At().
OTOH, people that program in C++ usually know that A[i++]=A[i] is a nonsense.

Quote:


Well, yes, I think that is the "official" C++/boost path... If you like that, U++ pick_ must sound alien to you Wink



Uhm... I don't know Boost++ in depth, but I don't think PIMPL+reference counting is their base path.
I know that reference counting + pointers is an hassle, but together with PIMPL and WITHOUT use of pointers can be quite good. That said, I don't like too much Boost++, I find it well written but old style coding. I did write my own Array class in past because of that.
BTW, I still think that c++ standard is missing many useful constructs, one of the most useful ot them is the 'property' one, which borland introduced as a language extension in their compilers.
An object-oriented language without properties is an empty wine glass, I think Smile

Just an example of it :
class C
{
  private:

  int iVal;

  void set_iVal(int _i) { i = _iVal; }
  int get_iVal(void) { return iVal; }

  public:

  __property i = { read = getIval, write = setIval };

};

C c ;

c.i = 5;  // calls set_Ival(5)
int a = c.i; // calls a = get_Ival()

That's what I call 'clean object-oriented language'.

Ciao

Max
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: "init" files in packages...
Next Topic: ProgessIndicator::SetColor
Goto Forum:
  


Current Time: Mon Jul 07 23:24:21 CEST 2025

Total time taken to generate the page: 0.03742 seconds