Boost logo

Boost-Build :

From: Rick Yang (rick68_at_[hidden])
Date: 2008-06-07 11:55:08


Hi all,

I tried the rule vector.insert in my test code:
#--------------------------------------------------------------
import container ;
import "class" ;
import assert ;

v1 = [ class.new vector 68 500 999 ] ;
$(v1).insert 4 : 000 ;

assert.result 68 500 000 : $(v1).get ;
#--------------------------------------------------------------

The result maybe should "68 500 999 000", but vector.insert remove last
element "999".
I patch it.

#-----------------------------------------------------------------------------------------------------------
--- container.jam.orig 2008-05-02 18:01:35.000000000 +0800
+++ container.jam 2008-06-07 23:50:04.000000000 +0800
@@ -150,9 +150,12 @@
         : value # The value to insert.
         )
     {
- local left = $(self.value[1-$(index)]) ;
- left = $(left[1--2]) ;
         local right = $(self.value[$(index)-]) ;
+ local left = $(self.value[1-$(index)]) ;
+ if $(right)
+ {
+ left = $(left[1--2]) ;
+ }
         self.value = $(left) $(value) $(right) ;
     }
#-----------------------------------------------------------------------------------------------------------

  Best regards,
    Rick Yang





Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk