diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 5f2b2f9c..ede2b6b4 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -17869,6 +17869,19 @@ to which [code]#DataT# is implicitly convertible. Note that conversion operator shall not be templated to allow standard conversion sequence for implicit conversion. +a@ +[source] +---- +template +explicit operator T() const +---- +a@ _Constraints:_ [code]#NumElements# is equal to 1. +The type [code]#DataT# can be explicitly converted to [code]#T# via +[code]#static_cast#. +The type [code]#T# is not [code]#DataT#. + +_Returns:_ The value of the vector's element converted to [code]#T#. + a@ [source] ---- @@ -18661,6 +18674,10 @@ operator vector_t() const #endif operator DataT() const + +template +explicit operator T() const + static constexpr size_t byte_size() noexcept static constexpr size_t size() noexcept diff --git a/adoc/headers/vec.h b/adoc/headers/vec.h index 854294e2..6d2ea017 100644 --- a/adoc/headers/vec.h +++ b/adoc/headers/vec.h @@ -58,6 +58,10 @@ template class vec { // Available only when: NumElements == 1 operator DataT() const; + // Available only when: NumElements == 1 + template + explicit operator T() const; + static constexpr size_t byte_size() noexcept; static constexpr size_t size() noexcept;