Help with template function parameters

Started by
39 comments, last by null_pointer 21 years, 7 months ago
quote:I''m a bit lost in this discussion so I apologize if I''m repeating stated material.


You are; apology accepted.


quote:So it''s a life long and well debated problem that you cannot take non const ref to temporaries (Search comp.lang.c++.moderated archives). The cons outweight the pros if we allow that.


I do not want to allow non-const references to temporaries; I want P1& to be detected as const when P1 is the type of a temporary being passed to the function template. Same thing for literals. String literals have a slightly different problem... See my previous post for more information about these issues.


quote:If you set it to take a const ref, then comeau compiles it happily.


(eight...)


quote:Note: Amazingly, VC++ 6 compiles it everything ! I should have known earlier to use another compiler to test.


Yeah, maybe I should have stayed with VC++ 6. j/k

This topic is closed to new replies.

Advertisement