@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11



Comments:

<0> Sergey, you need a forward declaration
<1> i made one
<2> Sergey : add "cl*** rObjList;" before cl*** rObject
<0> right
<1> cl*** rObjList; cl*** rObject{... void operator=(rObjList *v){...}}; cl*** rObjList{};
<1> look again
<1> i found the problem :)
<2> Sergey : if in the body of operator= you're using rObjList - you need full declaration, and not just forward
<2> full definition
<3> cn28h nice tips
<0> :D
<1> nope
<1> i just can't use it inline :)
<1> i'm using cl*** a with pointer to cl*** b, and cl*** b with pointer on cl*** a (this)
<4> are there known newb mistakes when using templates and iterators?
<5> bwahahah



<5> to asnwer your question, sure.
<4> 37 C:\MUDLib\SocketLib\ConnectionManager.h type `std::list<SocketLib::Connection<protocol>, std::allocator<SocketLib::Connection<protocol> > >' is not derived from type `SocketLib::ConnectionManager<protocol, defaulthandler>'
<5> most common is not using the typename keyword
<4> thats there
<4> im trying to typedef a iterator
<4> typedef std::list< Connection<protocol> >::iterator clistitr;
<4> why is it drawing a connection between allocators and iterators?
<5> because the allocator is also a template parameter
<5> but it defaults to std::allocator
<5> try isntead
<5> typedef typename std::list<Connection<protocol> >::iterator clistitr;
<5> er wait
<5> well whatever, you get the idea
<4> yea
<5> did that sort you out?
<4> hmm, it might have worked, all these other errors come up now, but they are similar lines
<5> yea post code
<5> paste
<5> at www.rafb.net/paste quickly, I'm about to sleeepe
<4> well, its from a book, its like 70 files long
<5> the header file is?
<5> paste your template definition
<5> for ConnectionManager
<4> http://www.rafb.net/paste/results/TMY2PM53.html
<4> oh, ConnectionManager template def is template<typename protocol, typename defaulthandler>
<4> cl*** ConnectionManager
<4> {
<5> well you have typename missing
<4> http://www.rafb.net/paste/results/DAGFJ920.html
<5> what you pasted is not complete
<4> thats the whole header file for ConnectionManager
<4> you mean the first link i gave?
<5> my patience
<5> ok, look.
<5> Please paste code, PLUS ERRORS
<5> with line numbers
<4> it would take too long, theres a ton of errors and a ton of code, and i don't want to keep you up
<5> well you realise
<5> chances are teh first error causes the rest
<5> and if you do it and I can't help, someone else can
<4> one second
<4> http://www.rafb.net/paste/results/2GhHtN59.html
<4> the error is on line 104 is actually on 110 in the pastebin
<4> er 111, its marked
<6> looks like you need a 'typename' there
<5> again, add typename
<5> it's a dependent name
<5> the compiler doesn't know that it's a type, and ***umes it's a static member
<5> variable
<4> why doesn't it give an error on line 110 (right above it)
<6> because there's no question that that's a type
<6> on line 111, depending on what 'entity' is instanciated as, ::iterator might be a type... it might be a member function, or something else
<5> themime: consider some cl*** A. A<T>::moo
<5> er
<5> A<T>::moo* p;
<5> am I doing moo times p, or is p a pointer to type moo
<4> ah ok
<4> ok, in that same code, at line 115, it has error: 108 C:\..\Databases.h `m_container' undeclared (first use this function)
<5> so, typename resolves the issue
<5> yes, what's m_container
<4> its declared right above, albeit in a different cl***



<4> protected
<6> template<typename T> struct A{ typedef int moo; }; template<> struct A<float>{ int moo; };
<6> see how A<T>::moo takes a different meaning, depending on if T is float or not
<4> yea
<4> ok, with that protected member...the person who wrote this code, wtf was he thinking?
<6> i don't expect most programmers think at all
<4> OH, actually
<4> shouldn't it work
<4> its protected
<4> look at line 107
<4> it inherits from Database
<5> hmm
<5> protected is fine
<4> then why do i get the error?
<5> off the top of my head I dunno...I haven't done much templated inhertiance
<5> there's probably some rule you're not adhering to, or I'm missing somethign
<5> hang on let me brush teeth and come back
<4> k
<4> would it have worked under an older compiler perhaps? this code is from a book made in 2003
<6> where's the error now?
<4> ok, in that same code, at line 115, it has error: 108 C:\..\Databases.h `m_container' undeclared (first use this function)
<4> but its a protected member of the inherited Database cl***
<6> what compiler?
<4> mingw32 3.4.2 (its Dev-C++)
<6> looks like you're missing some includes
<6> like
<6> string
<6> fstream
<6> is that the FIRST error you're getting?
<4> no
<6> well then it's useless to know
<4> ill fix the other, sec
<4> ok, now its the first error
<6> well let's see the current code
<4> that file hasn't changed
<6> then you didn't fix the typename error
<4> the error was in this homemade Exception cl***, the person who wrote it didn't do a proper deconstructor
<4> oh, i guess it has then, one sec
<4> http://www.noidea128.org/
<6> oh
<6> you need to say this->m_container.size()
<6> or... try that
<6> if it does work, i know why
<6> when you inherit from a templated base cl***, you must use this-> to access it's members
<6> it's the same sorta idea for why you need typename
<6> you need to tell the compiler that m_container is really a member
<6> I believe this is the only case where you must use this-> to access a member
<4> right right, ill try that now
<4> i think its working
<6> you probably need to do the same for the other places you access m_container
<4> right
<4> and there was another typename problem
<6> yup
<4> a few of em
<4> i think 90% of my errors are cause of that, maybe he developed on a weird compiler where it wasn't an issue
<4> cause it was 3 years ago
<4> i need to go now, thanks a lot for your help, i may be back if any other weirdness arrises!
<7> is it possible to make a program in C++ that reads a variable when you press a key and continues if you don't press any key?
<7> is there a OnKeyPress-type function?
<8> kbhit with some short circut method maybe?
<7> uh?
<8> just igrnore me
<7> lol
<7> what i want is the program to skip to another line if the user presses a key
<7> but continues inside that cycle if the key isn't pressed
<8> if your compiler supports it kbhit is a function in conio.h and is not standart
<8> short circut method is using operator precedence to validate or invalidate flow of the application depending on conditions using && ot ||
<8> or*
<8> i dunno if they are usefull for you
<8> bored cuz commercials in the movie i am watchin on tv took so long
<8> :\
<9> So many words to say if (x)
<7> y was using a cin
<7> but the program doesn't continue unless you type a value


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

PiraTTeaM
free bnc hosting
fink lsusb
longest-living land mammal after man
#mirc
Question....... What river begins in Syria and passes through Lake Tiberias int
+like usb over network
Copy a file from windows to linux
c++ SPI_SETMOUSE
cheep ass buda



Home  |  disclaimer  |  contact  |  submit quotes