New user self-registration is currently disabled. Please email eigen-core-team @ if you need an account.
Bug 96 - Clean internal::result_of
Clean internal::result_of
Product: Eigen
Classification: Unclassified
Component: Core - general
3.3 (current stable)
All All
: Normal Internal Design
Assigned To: Gael Guennebaud
: 1279 (view as bug list)
Depends on:
Blocks: 81 3.4
  Show dependency treegraph
Reported: 2010-10-26 15:25 UTC by Gael Guennebaud
Modified: 2016-08-23 14:55 UTC (History)
6 users (show)


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:

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. ***

Note You need to log in before you can comment on or make changes to this bug.