Ticket #2851: boost_bug.cpp

File boost_bug.cpp, 552 bytes (added by anonymous, 14 years ago)
Line 
1// boost_bug.cpp : Defines the entry point for the console application.
2//
3
4#include "stdafx.h"
5#include <vector>
6#include "boost/foreach.hpp"
7
8class Item
9{
10
11};
12
13class TestClass
14{
15public:
16 typedef std::vector<Item*> ItemContainer;
17
18 long getIndex (const Item* searchItem) const
19 {
20 long index = 0;
21 BOOST_FOREACH (Item* n, *mCollection)
22 {
23 if (searchItem == n) return index;
24 ++index;
25 }
26
27 return -1;
28 }
29
30private:
31 ItemContainer* mCollection;
32};
33
34
35
36int _tmain(int argc, _TCHAR* argv[])
37{
38 return 0;
39}
40