LayoutBuilder: document C++ method chaining behavior

Fixes #8515.
This commit is contained in:
Adrien Destugues 2015-01-07 17:27:51 +01:00
parent 61c227c6eb
commit 6aa4d138bf

View File

@ -90,6 +90,20 @@ BLayoutBuilder::Group<>(B_HORIZONTAL)
// back to the Group<>::GridBuilder
\endcode
Note that the C++ language does not impose any sequence points in such
method chains. This means the arguments to all calls may be evaluated in an
unexpected order. For exemple, the following code may not result in adding
the 3 views in rows 0, 1 and 2 in the target grid:
\code
// Don't do this!
int row = 0;
BLayoutBuilder::Grid<>(target)
.Add(viewA, row++)
.Add(viewB, row++)
.Add(viewC, row++);
\endcode
\since Haiku R1
*/