--- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-26 20:34
---
Here's a detailed explanation of the second example:
You are calling the function "void HandleObject(TObject toj);" as follows:
"HandleObject( GetAnObject() );"
To do this you need a copy constructor to co
--- Additional Comments From profvonsully at yahoo dot com 2004-10-26 19:21
---
!!!
in the second example only one constructor is writeed (to be compiled)
"TObject(rTObject)"!!(the other one is in a coment and ... errror)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18113
--- Additional Comments From profvonsully at yahoo dot com 2004-10-26 19:05
---
(In reply to comment #7
i dont care about the const . i descovered the bug in the first example of the
attcahment where the compiler prints an error that is not logic(in borland C++
i used TObject(rObject)
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-26 18:48
---
TObject(const rObject){} is the same as TObject(TObject&){}
The const is ignored.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18113
--- Additional Comments From profvonsully at yahoo dot com 2004-10-26 18:45
---
(In reply to comment #2)
> look at the attahement !
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18113
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-26 18:44
---
Read my comment again, this is not a bug.
--
What|Removed |Added
Status|UNCONFIR
--- Additional Comments From profvonsully at yahoo dot com 2004-10-26 18:41
---
there is another example for those that did not look at the attachment(sorry
for my initial language):
class TObject;
typedef TObject& rObject;
class TObject
{
public:
TObject(){
--- Additional Comments From bangerth at dealii dot org 2004-10-22 18:53 ---
Your second copy constructor will be called every time the argument
given can't be bound to a reference. The code is perfectly legal, and
the compiler needs to accept it.
W.
--
http://gcc.gnu.org/bugzilla
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-22 17:13
---
Not a bug. The "const" in "const rObject" is meaning less in this context (the
rObject is already const,
references are const, what they refer to are not).
--
What|Removed
--- Additional Comments From profvonsully at yahoo dot com 2004-10-22 16:53
---
Created an attachment (id=7402)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7402&action=view)
html file describing the bug
no comment ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18113
10 matches
Mail list logo