This bugzilla service is closed. All entries have been migrated to
Bug 96 - Clean internal::result_of
Summary: Clean internal::result_of
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Internal Design
Assignee: 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: 2019-12-04 09:53 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. ***
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'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:

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