bughunt: replace the ConfigResolver with a direct instantiation of Singleton -> MISS
thus not lib::Singleton is the culprit, it must be lib::SingletonSubclass
This commit is contained in:
parent
10a511d29c
commit
72bd94e141
3 changed files with 13 additions and 10 deletions
|
|
@ -1,25 +1,25 @@
|
|||
#include "lib/test/run.hpp"
|
||||
|
||||
#include "proc/config-resolver.hpp"
|
||||
#include "clang-static-init.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using proc::ConfigResolver;
|
||||
|
||||
using ::test::Test;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
using namespace test;
|
||||
|
||||
int
|
||||
main (int, char**)
|
||||
{
|
||||
cout << "\n.gulp.\n";
|
||||
|
||||
ConfigResolver& ref1 = ConfigResolver::instance();
|
||||
Factory fab1;
|
||||
Subject& ref1 = fab1();
|
||||
|
||||
ConfigResolver& sub2 = test::fabricate();
|
||||
Subject& sub2 = test::fabricate();
|
||||
|
||||
cout << "sub1="<< &ref1 << " sub2="<< &sub2 <<"\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using proc::ConfigResolver;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
|
|
@ -21,14 +20,15 @@ namespace test {
|
|||
|
||||
|
||||
namespace {
|
||||
Holder<Subject> fab2;
|
||||
// Holder<Subject> fab2;
|
||||
Factory fab2;
|
||||
}
|
||||
|
||||
|
||||
ConfigResolver&
|
||||
Subject&
|
||||
fabricate()
|
||||
{
|
||||
return ConfigResolver::instance();
|
||||
return fab2();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
#include "lib/error.hpp"
|
||||
|
||||
#include "proc/config-resolver.hpp"
|
||||
#include "lib/singleton-subclass.hpp"
|
||||
|
||||
|
||||
namespace test {
|
||||
|
||||
|
|
@ -33,8 +34,10 @@ namespace test {
|
|||
|
||||
};
|
||||
|
||||
typedef lib::Singleton<Subject> Factory;
|
||||
|
||||
proc::ConfigResolver& fabricate();
|
||||
|
||||
Subject& fabricate();
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue