|Product:||Eigen||Reporter:||Gael Guennebaud <gael.guennebaud>|
|Component:||Core - general||Assignee:||Gael Guennebaud <gael.guennebaud>|
|Severity:||Internal Design||CC:||alejandro.castro, chtz, gael.guennebaud, hauke.heibel, jacob.benoit.1, twan_koolen|
|Version:||3.3 (current stable)|
|Bug Depends on:|
|Bug Blocks:||81, 814|
Description Gael Guennebaud 2010-10-26 15:25:29 UTC
See comments in the source code, and more importantly document it in the doc for writing functors, and add a unit test.
Comment 1 Christoph Hertzberg 2015-04-30 19:47:13 UTC
As mentioned in Bug 1006, we should also decide where using result_of is necessary, at all. Essentially, I only see binaryExpr(other, Func) and unaryExpr(Func) (from plugins/CommonCwiseBinaryOps.h) where this is should be used. And as we can't really rely on TR1/C++11 to be available, probably, we should probably just check if Func::result_type exists and use ArgType0 otherwise.
Comment 2 twan_koolen 2016-01-27 00:54:35 UTC
Thank you for addressing the redux issue in bug 1006! Unfortunately, I'm running into similar issues with scalar types that are themselves aligned in the traits class for CWiseUnaryOp, specifically the Scalar typedef: typedef typename result_of< UnaryOp(typename XprType::Scalar) >::type Scalar; Again, passing by value results in C2719 on MSVC (2015 in my case) 32 bit.
Comment 3 Gael Guennebaud 2016-01-28 11:19:24 UTC
Should be fixed by: https://bitbucket.org/eigen/eigen/commits/f2e6b911501d/ We can still wonder whether we want to support the TR1 protocol, or not? It's not really tested, and since it is not documented, I doubt that anybody is using it. Moreover, it does not work in C++11 mode.
Comment 4 twan_koolen 2016-01-28 18:59:38 UTC
That fixed our issue. Thank you for another quick response!
Comment 5 alejandro castro 2016-08-23 14:55:55 UTC
*** Bug 1279 has been marked as a duplicate of this bug. ***
Comment 6 Gael Guennebaud 2018-10-09 19:30:45 UTC
There is no need to spend effort in cleaning/improving result_of anymore since we use std::result_of when available.
Comment 7 Nobody 2019-12-04 09:53:45 UTC
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/96.