<divclass="content sourceset-depenent-content"data-active=""data-togglable=":kmath-core:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">inline </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token operator"> : </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><spanclass="token operator">></span><ahref="auto.html"><spanclass="token function">auto</span></a><spanclass="token punctuation">(</span>type<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-class/index.html">KClass</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">, </span>size<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span>initializer<spanclass="token operator">: </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="../index.html">Buffer</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token operator">></span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Creates a <ahref="../index.html">Buffer</a> of given <ahref="auto.html">type</a>. If the type is primitive, specialized buffers are used (<ahref="../../-int-buffer/index.html">IntBuffer</a>, <ahref="../../-double-buffer/index.html">DoubleBuffer</a>, etc.), <ahref="../../-list-buffer/index.html">ListBuffer</a> is returned otherwise.</p><pclass="paragraph">The <ahref="auto.html">size</a> is specified, and each element is calculated by calling the specified <ahref="auto.html">initializer</a> function.</p><br><divclass="symbol monospace"><spanclass="token keyword">inline </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token operator"> : </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><spanclass="token operator">></span><ahref="auto.html"><spanclass="token function">auto</span></a><spanclass="token punctuation">(</span>size<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span>initializer<spanclass="token operator">: </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="../index.html">Buffer</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="auto.html">T</a><spanclass="token operator">></span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Creates a <ahref="../index.html">Buffer</a> of given type <ahref="auto.html">T</a>. If the type is primitive, specialized buffers are used (<ahref="../../-int-buffer/index.