2013-09-29 01:08:15 +02:00
|
|
|
|
2013-09-30 00:42:27 +02:00
|
|
|
#include "clang-static-init.hpp"
|
2013-09-29 01:08:15 +02:00
|
|
|
|
|
|
|
|
|
2013-10-06 18:58:32 +02:00
|
|
|
test::Subject&
|
|
|
|
|
localFunction()
|
|
|
|
|
{
|
|
|
|
|
return test::fab.get();
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-29 01:08:15 +02:00
|
|
|
|
2013-09-30 00:42:27 +02:00
|
|
|
int
|
|
|
|
|
main (int, char**)
|
|
|
|
|
{
|
2013-10-06 18:58:32 +02:00
|
|
|
cout << "\nStart Testcase: invoking two instances of the configurable singleton factory...\n\n";
|
2013-09-30 00:42:27 +02:00
|
|
|
|
2013-10-06 18:50:53 +02:00
|
|
|
test::Subject& ref1 = test::fab.get();
|
2013-10-06 18:58:32 +02:00
|
|
|
test::Subject& sub2 = test::fabricate(); ///NOTE: invoking get() from within another compilation unit reveales the problem
|
|
|
|
|
test::Subject& sub3 = localFunction();
|
2013-09-30 00:42:27 +02:00
|
|
|
|
2013-10-06 18:58:32 +02:00
|
|
|
cout << "sub1=" << &ref1
|
|
|
|
|
<< "\nsub2="<< &sub2
|
|
|
|
|
<< "\nsub3="<< &sub3
|
|
|
|
|
<< "\n";
|
2013-09-30 00:42:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|