[Boost-bugs] [Boost C++ Libraries] #4443: Bounded vector constructor missing explicit and an initialization version

Subject: [Boost-bugs] [Boost C++ Libraries] #4443: Bounded vector constructor missing explicit and an initialization version
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-15 23:01:30


#4443: Bounded vector constructor missing explicit and an initialization version
------------------------------------------------+---------------------------
 Reporter: Jesse Perla <jesseperla@…> | Owner: guwi17
     Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: uBLAS
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 While vector<> has an 'explicit' on its constructor with unsigned
 integers, bounded_vector does not. This means the following ugliness
 compiles:
 bounded_vector<double, 2> v;
 v = 2; //This SHOULDN'T compile if the patch is applied. Using cast to
 unsigned int.

 Also, while vector<> 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<double> v(2, 1.8);
 ublas::bounded_vector<double,2> v(2, 1.8); //Now consistent.

 .... this became necessary when I was doing programming for generic vector
 types and wanted to construct with an initial value.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4443>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC