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,22 @@ } +Initialization Syntax +--------------------- +An empty value of a matrix type M can be initialised using this syntax: + +.. code-block:: c++ + + constexpr M m = {}; + +A non-empty value of a matrix type M can be initialised using the nested initialisation syntax: + +.. code-block: c++ + constexpr M m = {{a, b, c}, {d, e, f}} + +where the number of constituent arrays must equal the number rows in the matrix type M and the number of elements +in each constituent array must equal the number of columns in the matrix type. + TODOs ----- @@ -274,9 +290,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 =========================================