Boost C++ Libraries: Ticket #4443: Bounded vector constructor missing explicit and an initialization version https://svn.boost.org/trac10/ticket/4443 <p> While vector&lt;&gt; has an 'explicit' on its constructor with unsigned integers, bounded_vector does not. This means the following ugliness compiles: bounded_vector&lt;double, 2&gt; v; v = 2; <em>This SHOULDN'T compile if the patch is applied. Using cast to unsigned int. </em></p> <p> Also, while vector&lt;&gt; has a constructor that takes a size and then a value to initialize with, bounded_vector does not. I added in a constructor for this operation and for consistency, so the following compiles: ublas::vector&lt;double&gt; v(2, 1.8); ublas::bounded_vector&lt;double,2&gt; v(2, 1.8); <em>Now consistent. </em></p> <p> .... this became necessary when I was doing programming for generic vector types and wanted to construct with an initial value. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4443 Trac 1.4.3 Jesse Perla <jesseperla@…> Thu, 15 Jul 2010 23:01:47 GMT attachment set https://svn.boost.org/trac10/ticket/4443 https://svn.boost.org/trac10/ticket/4443 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bounded_vector_constructors.patch</span> </li> </ul> Ticket Jesse Perla <jesseperla@…> Thu, 15 Jul 2010 23:02:05 GMT attachment set https://svn.boost.org/trac10/ticket/4443 https://svn.boost.org/trac10/ticket/4443 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_boost_ublas_vector_constructors.cpp</span> </li> </ul> Ticket Jesse Perla <jesseperla@…> Wed, 11 Aug 2010 19:15:09 GMT <link>https://svn.boost.org/trac10/ticket/4443#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4443#comment:1</guid> <description> <p> I have been porting some of my code to GCC and may have made a mistake on here. the value_type is not available here, so it should be added as a typdef in the bounded_vector class: </p> <blockquote> <p> typedef typename vector_type::value_type value_type; </p> </blockquote> <p> Also, gcc didn't like my begin() and end() in the constructor with fill, so try adding a this-&gt;begin() and this-&gt;end() instead. I am not sure the best way to do this. </p> </description> <category>Ticket</category> </item> </channel> </rss>