Opened 12 years ago
Last modified 8 years ago
#4577 new Bugs
invoke() uses invalid boost::result_of<>
Reported by: | anonymous | Owned by: | t_schwinger |
---|---|---|---|
Milestone: | To Be Determined | Component: | fusion |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
struct F{ template<typename Sig> struct result; }; vector<int> const vec(5); invoke(F(),vec); // (1) int t(int i){ return i; } invoke(F(),transform(vec,&t)); // (2)
(1) uses F::result<F(int const &)>, while (2) uses F::result<F(int)>. I believe it should be (1) in both cases.
attaching test case and patch, which converts each argument type using fusion::detail::call_param
Attachments (2)
Change History (4)
by , 12 years ago
by , 12 years ago
Attachment: | invoke.patch added |
---|
comment:1 by , 12 years ago
Owner: | changed from | to
---|
comment:2 by , 8 years ago
Note:
See TracTickets
for help on using tickets.
I think that original behaviour is eligible in such situation.
In (1), as you know,
vec[n]
isconst lvalue reference
ofint
sincevec
isconst lvalue
ofvector
. However, in (2), the functiont
returnsprvalue
ofint
: means type off(vec[n])
is justint
.So, I'm against the suggestion.