This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Nested<int Times> instead of ei_nested?

Tags: None
(comma "," separated)
Tal
Registered Member
Posts
30
Karma
0
Does this syntax:
Code: Select all
class Foo
{
  template <int Times = 1>
  struct Nested
  {
    typedef Bar type;
  }
}


Could replace the currently explicit one:
Code: Select all
class Foo;
template <int Times>
struct ei_nested<Foo, Times>
{
    typedef Bar type;
};


There are two advantages:
[*] Easier to access - Foo::Nested<Times> instead of internal::ei_nested<Foo, Times>::type
[*] Easier to maintain

As you might see, the style was taken from from C++ Allocator concept rebind<U>::other
Do you think it should be used in future Eigen versions?


User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hm, ei_nested was for Eigen2 which is rather outdated! It does not exist in Eigen3.x. See also this entry for some old discussions on this topic: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=111
Tal
Registered Member
Posts
30
Karma
0
ggael wrote:hm, ei_nested was for Eigen2 which is rather outdated! It does not exist in Eigen3.x. See also this entry for some old discussions on this topic: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=111


Your claims conflict with this page: (something doesn't making sense for me)
http://eigen.tuxfamily.org/index.php?ti ... umentation

If this page is outdated too, what is the correct way now?


User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
oh, I was not aware of this page, and indeed it is completely outdated! In the default branch, you should use internal::nested_eval<XprType,N>::type.
Tal
Registered Member
Posts
30
Karma
0
ggael wrote:oh, I was not aware of this page, and indeed it is completely outdated! In the default branch, you should use internal::nested_eval<XprType,N>::type.

Please notice that the top two links in this wiki page are invalid. IMHO, they should refer to:
http://eigen.tuxfamily.org/dox-devel/To ... nType.html

Thanks!




Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar