last day (23 days later) » 

9:13 PM
1
A: How to resolve a series of errors about iterator constructors involving expected l-values, missing conversions, and viability

seheYou cannot bind temporaries to non-const references. iterator(iterator const& rhs) : data(rhs.data) {} iterator(std::list<Piece>::iterator rhs) : data(rhs) {} Note that iterators are conventially passed by value Live On Coliru #include <iterator> #include <list> #include <string> #in...

 
Wow, that was fast. I'll put more code in the question...
OK, I pasted the entirety of the rest of the class, barring the # lines. Does that address the blind?
 
@hepcat72 yep that helped
 
What does the colon do in your fix? I.e. What does " : data(rhs.data)" do?
 
It's an initializer list: search for [c++-faq] colon constructor: stackoverflow.com/questions/1711990/… (only 106 upvotes... some 200+ in the answers)
 
Awesome. That resolved the errors! Yay! Thanks so much! So fast too. I just have to propagate this fix to the other iterators and then see if anything new pops up in the errors.
Alright. One of my iterator classes is a bit different than the others and is still generating errors about the != and the = operators. Should I edit my question above, post a brand new question, or is there some way to post followup questions that spawn from a current question?
 
9:13 PM
Post a brand new question, unless you think it's of no value to others, in which case consider just paste-binning and linking it here
There, if you have 20+ rep you can also chat
 
OK
So here are the errors:
TranslationList.cpp:38:55: error: out-of-line definition of 'operator=' does not match any declaration in 'TranslationList::iterator'
TranslationList::iterator& TranslationList::iterator::operator=(iterator& rhs)
^~~~~~~~
./TranslationList.h:28:31: note: type of 1st parameter of member declaration does not match definition ('const TranslationList::iterator &' vs 'TranslationList::iterator &')
iterator& operator=(const iterator&);
^
TranslationList.cpp:54:28: error: out-of-line definition of 'iterator' does not match any declaration in 'TranslationList::iterator'
And the class:
Cool. I'm going to use that for my blog...
How do I put code tags in here?
 
Oh please. paste.ubuntu.com or similar
 
Cool, I'm going to use that for my blog
 
first/last are not implemented
By the way, I'm live-streaming if you don't mind: livecoding.tv/sehe
 
Oh, they're in the .cpp file. I'll paste that too.
Sure, that's fine
Would you like to see the whole class or just those function definitions?
 
9:19 PM
Wollt Ihr den totalen Krieg?
Ja, wir wollen den totalen Krieg!
(brb MOAR TEA)
 
Ha
By total war, do you mean the whole class?
 
Whatever you can offer :/
 
I assume that compilers have either gotten more stringent or the compiler I was using pre-mac os x was just crap back then in 2000. I think it was in a package called CodeWarrior.
 
Are you watching the stream?
@hepcat72 CodeWarrior is/was pretty crappy
 
Oh, sorry. Wife was trying to convince me to stop coding...
 
9:28 PM
Maybe you should. I have good music though :)
 
yes it is!
looking good
BTW, she left.
 
:)
Here's a working compiling piece of code. Didn't track what I fixed around.
But I do know you had some "stale" implementation(s) of operator=(TranslationList&) still there.
Of course I stubbed Piece with ridiculous members to to make it compile
 
Yeah, I was a student back then, just learning
 
15 years in the making :)
Are you prepping a CV or really using the code
 
It's just for fun actually. I was telling someone about it the other day and decided to see if I could resurrect it.
Well, I got past the iterator errors. Now I have a ton of undefined symbol errors. Wife and I are supposed to go to a wine and cheese thing, so I'll have to come back to this. Really appreciate the help though. Man, you're great!
 
9:41 PM
@hepcat72 Is there a repo (e.g. bitbucket or github)?
@hepcat72 Chee(r)s
 
They didn't exist in 2000 ;)
I'll put it up though. Maybe later tonight or tomorrow
 
Ok! I could have a look. Be sure to include the "pristine" (2000) revision too. And then commit your changes since then over it?
 
 
2 hours later…
11:15 PM
livecoding.tv/video/very-slow-night-chatter-and-good-music in case you want to ever review how/what I did there
Actually, the first part is here at around 11 minutes in: livecoding.tv/video/chat-assist-on-some-iterator-code-from-2000
 

  last day (23 days later) »