OSDN Git Service

481d5058c975adaf4587bbdaeca53c23b8abc28d
[roast/roast.git] / roast / test / thread_test / thread_pool_test.cpp
1 //#include "roast/thread/thread_pool.hpp"
2 #include "roast/std/foreach.hpp"
3 #include "roast/container/any_iterator.hpp"
4 #include "roast/container/stl_iterator_to_roast.hpp"
5
6 namespace roast
7 {
8         ////////////////////////////////////////////////////////////////////////
9
10         template <typename T>
11         any_iterator<T> get_iterator( ::std::vector<T>& ary )
12         {
13                 return new _attach_iterator_base<T,
14                         _stllike_uni_iterator_to_roast_impl< ::std::vector<T> >
15                         >( _stllike_uni_iterator_to_roast_impl< ::std::vector<T> >(ary) );
16         }
17 }
18
19 class hoge
20 {
21 };
22 class hoge2 : public hoge
23 {
24 public:
25         int a;
26         int c;
27
28         /*hoge2(const struct hoge &h){
29                 const struct hoge2 &p = h;
30         }*/
31         ~hoge2(){ printf("hoge2 Release.\n"); }
32         hoge2(int a_,int c_){ a = a_; c = c_; }
33 };
34
35 void zzz(const hoge &l)
36 {
37         hoge2 &bq1 = (hoge2&)l;
38         printf("%d, %d\n", bq1.a, bq1.c);
39 }
40
41 using namespace roast;
42 int main()
43 {
44         /*zzz(hoge2(10,20));
45         hoge *ddd = &hoge2(10,20);
46         hoge2 *bq2 = (hoge2*)ddd;
47         printf("%d, %d\n", bq2->a, bq2->c);
48
49         hoge &bq = hoge2(10,20);
50         printf("Sizeof = %d\n", sizeof(bq) );
51         hoge2 &bq1 = (hoge2&)bq;
52         printf("%d, %d\n", bq1.a, bq1.c);*/
53
54         /*std::vector<int> vi;
55         vi.push_back(1);
56         vi.push_back(3);*/
57         int vi[] = {3,4,5,6};
58
59         /*
60         any_iterator<int> it = get_iterator(vi);
61         while(it.in_while())
62         {
63                 printf("%d\n", *it);
64         }
65         */
66         ROAST_FOREACH(int x, vi)
67         {
68                 printf("%d\n", x);
69         }
70         //ROAST_FOREACH_END
71
72         /*for(size_t i=0; i<vi.size(); i++)
73         {
74                 printf("%d\n", vi[i]);
75         }*/
76
77         return 0;
78 }
79
80 void aaaa(int b[4])
81 {
82
83 }