mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-13 18:37:27 +08:00
Fix triangularView versus triangularPart.
This commit is contained in:
parent
4252af6897
commit
6eff3e5185
@ -73,13 +73,13 @@ for operator<".
|
||||
The reason that the \c template keyword is necessary in the last example has to do with the rules for how
|
||||
templates are supposed to be compiled in C++. The compiler has to check the code for correct syntax at the
|
||||
point where the template is defined, without knowing the actual value of the template arguments (\c Derived1
|
||||
and \c Derived2 in the example). That means that the compiler cannot know that <tt>dst.triangularPart</tt> is
|
||||
and \c Derived2 in the example). That means that the compiler cannot know that <tt>dst.triangularView</tt> is
|
||||
a member template and that the following < symbol is part of the delimiter for the template
|
||||
parameter. Another possibility would be that <tt>dst.triangularPart</tt> is a member variable with the <
|
||||
parameter. Another possibility would be that <tt>dst.triangularView</tt> is a member variable with the <
|
||||
symbol refering to the <tt>operator<()</tt> function. In fact, the compiler should choose the second
|
||||
possibility, according to the standard. If <tt>dst.triangularPart</tt> is a member template (as in our case),
|
||||
possibility, according to the standard. If <tt>dst.triangularView</tt> is a member template (as in our case),
|
||||
the programmer should specify this explicitly with the \c template keyword and write <tt>dst.template
|
||||
triangularPart</tt>.
|
||||
triangularView</tt>.
|
||||
|
||||
The precise rules are rather complicated, but ignoring some subtleties we can summarize them as follows:
|
||||
- A <em>dependent name</em> is name that depends (directly or indirectly) on a template parameter. In the
|
||||
|
Loading…
x
Reference in New Issue
Block a user