summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/numeric/odeint/toolset.jam.patch
blob: dca997d5a0c430c9519c21cbf1cd79cef5e03c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --git a/src/build/toolset.jam b/src/build/toolset.jam
index b5defd5..a942cd9 100644
--- a/src/build/toolset.jam
+++ b/src/build/toolset.jam
@@ -17,6 +17,8 @@ import regex ;
 import sequence ;
 import set ;
 import property-set ;
+import order ;
+import "class" : new ;
 
 
 .flag-no = 1 ;
@@ -237,6 +239,7 @@ rule handle-flag-value ( value * : properties * )
     if $(value:G)
     {
         local matches = [ property.select $(value) : $(properties) ] ;
+        local order ;
         for local p in $(matches)
         {
             local att = [ feature.attributes $(p:G) ] ;
@@ -263,11 +266,24 @@ rule handle-flag-value ( value * : properties * )
                 }
                 if path in $(att)
                 {
-                    result += [ sequence.transform path.native : $(values) ] ;
+                    values = [ sequence.transform path.native : $(values) ] ;
                 }
-                else
+                result += $(values) ;
+                if $(values[2])
                 {
-                    result += $(values) ;
+                    if ! $(order)
+                    {
+                        order = [ new order ] ;
+                    }
+                    local prev ;
+                    for local v in $(values)
+                    {
+                        if $(prev)
+                        {
+                            $(order).add-pair $(prev) $(v) ;
+                        }
+                        prev = $(v) ;
+                    }
                 }
             }
             else
@@ -275,6 +291,11 @@ rule handle-flag-value ( value * : properties * )
                 result += $(p:G=) ;
             }
         }
+        if $(order)
+        {
+            result = [ $(order).order [ sequence.unique $(result) : stable ] ] ;
+            DELETE_MODULE $(order) ;
+        }
     }
     else
     {