Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Iterator problem

Wostream & operator<< (wostream &out, const table &t)
{
: : Iterator ir; list<row>;
Table p (t);
U ir=tcbegin () error ;[/u] 4003rd

Ir=pcbegin ();

Cout<< "table :" "<pcsize ()" <endl;
Out<<*ir<<endl;
Return out;
}
I would like to come to the traditional parameters of operation, but not through the compiler.
If indirect way to produce a copy of Scientology] parameters of the copy operation can be carried out.
I do not know why?
Wrong message :
No appropriate function found for call of 'operator ='.

Last viable candidate was "Std : : __rw_list_iter<row, long, row
* Row &>; &std : : __rw_list_iter<row, long, * row, row &>; : : operator = (const Std : : __rw_list_iter<row, long, * row, row &>; &) "
[ "/opt/aCC/include_std/list", Line 72].

Argument of type 'class __rw_list_iter<row, long, const row *, const row &>;' could not be converted to 'const Std : : __rw_list_iter<row, long, * row, row &>; & '.

Ir=tcbegin ();

Iterator problem

Ir=tcbegin ();
Changed
Ir=pcbegin ();
Try

Iterator problem

The way to do so is my eldest child.
But I do not want to do, because it was hard to see, efficiency is low.

Iterator problem

No one will know the answer? Em08 : :

Iterator problem

Then the wostream & operator<< (wostream &out, const &t table) changed the definition
Wostream & operator<< (wostream &out, table &t)

Iterator problem

This change is not right. Compiler suggested :
Error 587 : "table.cpp" The left side of # 50 line '=' must be a modifiable lvalue. Did you forget to define an 'operator =' for 'const 14.00
__rw_list_iter<row, Long, * row, row &>; 'and' class
__rw_list_iter<row, Long, * row, row &>; '?
Ir=tcbegin ();

Iterator problem

Able to table affixed to the definition?

Iterator problem

[quote= "Prc"] can table affixed to the definition? [/quote]-->-->
Brother, I beg your pardon, you said is correct, const removed and the problem solved. Let me just begin when some other places, leading to this change, the same can not be translated. He found the problem, it's a solution.

However, this change is not particularly good, I later found a safe way to do this is the iterator statement, a statement of support const iterator.
Stl const_iterator is a dry inside the living.
Therefore, later, the code read :
Wostream & operator<< (wostream &out, const table &t)
{
: : Const_iterator ir; list<row>;
Ir=tcbegin ();
Out<<*ir<<endl;
Return out;
}
Like a success.
Therefore, I wrote an article posted on his blog inside.
Here, I would like to thank you for the prc!

Iterator problem

Oh, rudeness

Dual contact STL is just not long.



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com