Opened 9 years ago
Closed 4 years ago
#9363 closed Bugs (fixed)
Reference forwarding in phoenix::bind does not work in C++11
Reported by: | Andrey Semashev | Owned by: | Thomas Heller |
---|---|---|---|
Milestone: | To Be Determined | Component: | phoenix |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: |
Description
When a user-defined function accepts a non-const reference as an argument, this argument is provided as a const reference by phoenix::bind, even though phoenix::bind is invoked with a non-const lvalue. This only appears in C++11 mode, in C++03 this works as expected.
I've attached the test case and compile errors from GCC 4.8.1.
Attachments (2)
Change History (5)
by , 9 years ago
Attachment: | phoenix_non_const_ref.cpp added |
---|
comment:1 by , 9 years ago
I might add that this bug affects Boost.Log in a very bad way. It breaks binding user-defined functions as formatters because the output stream is passed to the bound functions by const reference.
comment:2 by , 9 years ago
I have started to look at this but have not got very far with this yet. I will keep it on my list. John
comment:3 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The test case compiles with gcc 8.2 with Boost 1.68.
A test case to reproduce the problem.