equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 // STLport regression testsuite component. |
|
19 // To compile as a separate example, please #define MAIN. |
|
20 |
|
21 #include <algorithm> |
|
22 #include <vector> |
|
23 #include <iostream> |
|
24 |
|
25 #ifdef MAIN |
|
26 #define lwrbnd1_test main |
|
27 #endif |
|
28 |
|
29 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES) |
|
30 using namespace std; |
|
31 #endif |
|
32 int lwrbnd1_test(int, char**) |
|
33 { |
|
34 cout<<"Results of lwrbnd1_test:"<<endl; |
|
35 std::vector <int> v1(20); |
|
36 for(int i = 0; i < v1.size(); i++) |
|
37 { |
|
38 v1[i] = i/4; |
|
39 cout << v1[i] << ' '; |
|
40 } |
|
41 std::vector <int>::iterator location = lower_bound(v1.begin(), v1.end(), 3); |
|
42 cout |
|
43 << "\n3 can be inserted at index: " |
|
44 <<(location - v1.begin()) |
|
45 << endl; |
|
46 if ((location - v1.begin()) == 12) |
|
47 return 0; |
|
48 else |
|
49 return 1; |
|
50 } |