Well the culprit line is 318 which you haven't shown.
Anyways the error message is self-explanatory, it is illegal as per standard C++
to initialize a non-const reference with an rvalue.
Some compilers offer it as extension but that's unportable.

Re: How to fix "Warning: should not initialize a non-const referencewith a temporary"?

Sharad Kala wrote:
>>>>"/advantage/hlri_tools/sol/SUNWspro/prod/include/CC/Cstd/./vector",
>>>>line 318: Warning: should not initialize a non-const reference with a
>>>>temporary.
>>>
>>>Well the culprit line is 318 which you haven't shown.
>>
>>No, it's line 308 of <vector>.
>
> No, I think it's line 318 of <vector>

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!