diff --git a/clang/docs/MatrixTypes.rst b/clang/docs/MatrixTypes.rst --- a/clang/docs/MatrixTypes.rst +++ b/clang/docs/MatrixTypes.rst @@ -266,6 +266,20 @@ } +Initialization Syntax +--------------------- +A value of a matrix type M can be initialized with an initializer list: + +.. code-block:: c++ + + constexpr M m1 = {}; + constexpr M m2 = {{a, b, c}, {d, e, f}}; + +If the initializer list is empty, all elements of the matrix are zero-initialized. Otherwise, the initializer list +must consist of M::rows initializer lists, each of which must consist of M::columns expressions, each of which is used +to initialize the corresponding element of the matrix. For example, m[i][j] is initialized by the jth expression of the +ith initializer list in the initializer. Element designators are not allowed. + TODOs ----- @@ -274,9 +288,6 @@ convenient. The alternative is using template deduction to extract this information. Also add spelling for C. -Future Work: Initialization syntax. - - Decisions for the Implementation in Clang =========================================