singleton_test::get_const_instance();
| 77 | |
| 78 | //singleton_test::get_const_instance(); |
| 79 | int main() |
| 80 | { |
| 81 | printf("step %d: first line in main\r\n", ++__nstep); |
| 82 | fflush(stdout); |
| 83 | |
| 84 | // ����һ |
| 85 | const singleton_test& test1 = singleton_test::get_instance().init(); |
| 86 | const singleton_test& test2 = singleton_test::get_instance(); |
| 87 | test1.set("test1"); |
| 88 | test2.set("test2"); |
| 89 | |
| 90 | // ���������� VC2003 ����� release �汾ʱ�� |
| 91 | // �÷�ʽ���Ա�֤����ʵ���� main ֮ǰ������ |
| 92 | acl::singleton2<singleton_test2>::get_instance().init(); |
| 93 | acl::singleton2<singleton_test2>::get_instance().set("test1"); |
| 94 | acl::singleton2<singleton_test2>::get_instance().set("test2"); |
| 95 | return 0; |
| 96 | } |