no message
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@35 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
8c599321c7
commit
69936e7e81
27 changed files with 2073 additions and 495 deletions
35
tools/RegressionTest/Test_Factory.cpp
Normal file
35
tools/RegressionTest/Test_Factory.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <cstdio>
|
||||
#include <typeinfo>
|
||||
#include "Factory.h"
|
||||
#include "AbstractFactory.h"
|
||||
|
||||
template<typename T>
|
||||
void print_type()
|
||||
{
|
||||
printf("%s\n", typeid(T).name());
|
||||
}
|
||||
|
||||
using namespace ::Loki;
|
||||
|
||||
struct A1 {}; struct A2 {}; struct A3 {}; struct A4 {};
|
||||
struct A5 {}; struct A6 {}; struct A7 {}; struct A8 {};
|
||||
|
||||
typedef TL::MakeTypeList<A1, A2, A3, A4, A5, A6, A7, A8>::Result typelist1_t;
|
||||
|
||||
struct Abst : AbstractFactory<typelist1_t> {};
|
||||
|
||||
int main()
|
||||
{
|
||||
Factory<A1, int> a;
|
||||
CloneFactory<A1> b;
|
||||
|
||||
typedef AbstractFactory<typelist1_t> abst_t;
|
||||
|
||||
struct AA1 : ConcreteFactory<abst_t, OpNewFactoryUnit> {};
|
||||
AA1 a1;
|
||||
|
||||
struct AA2 : ConcreteFactory<Abst, OpNewFactoryUnit> {};
|
||||
|
||||
AA2 a2;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue