replace tabs with 4 spaces
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@681 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
30f4e933c1
commit
fd6b9484ee
16 changed files with 210 additions and 210 deletions
|
@ -17,10 +17,10 @@
|
|||
//***********************************************************
|
||||
//#include <boost/test/minimal.hpp>
|
||||
#include <iostream>
|
||||
#define BOOST_CHECK(exp) \
|
||||
( (exp) \
|
||||
? static_cast<void>(0) \
|
||||
: report_error(#exp,__FILE__,__LINE__) )
|
||||
#define BOOST_CHECK(exp) \
|
||||
( (exp) \
|
||||
? static_cast<void>(0) \
|
||||
: report_error(#exp,__FILE__,__LINE__) )
|
||||
|
||||
#define BOOST_ERROR(x) std::cout << x << "\n"
|
||||
inline void
|
||||
|
@ -39,16 +39,16 @@ report_error( const char* msg, const char* file, int line, bool is_msg = false )
|
|||
|
||||
#define TEST_LOKI_FUNCTION
|
||||
#ifndef TEST_LOKI_FUNCTION
|
||||
#include <boost/function.hpp>
|
||||
using namespace boost;
|
||||
#include <boost/function.hpp>
|
||||
using namespace boost;
|
||||
#else
|
||||
#define BOOST_FUNCTION_TARGET_FIX(x) x
|
||||
#define LOKI_CLASS_LEVEL_THREADING
|
||||
// disable to see "static instantiation order fiasco" crash
|
||||
#define LOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
|
||||
#include <loki/Function.h>
|
||||
using namespace Loki;
|
||||
#define function Function
|
||||
#define BOOST_FUNCTION_TARGET_FIX(x) x
|
||||
#define LOKI_CLASS_LEVEL_THREADING
|
||||
// disable to see "static instantiation order fiasco" crash
|
||||
#define LOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
|
||||
#include <loki/Function.h>
|
||||
using namespace Loki;
|
||||
#define function Function
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -739,7 +739,7 @@ static void test_ref()
|
|||
catch(runtime_error e)
|
||||
{
|
||||
#ifndef TEST_LOKI_FUNCTION
|
||||
BOOST_ERROR("Nonthrowing constructor threw an exception");
|
||||
BOOST_ERROR("Nonthrowing constructor threw an exception");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -809,6 +809,6 @@ int main()
|
|||
#else // #ifndef LOKI_FUNCTORS_ARE_COMPARABLE
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -275,16 +275,16 @@ void test_more()
|
|||
Loki::Printf("\n\nMore tests:\n");
|
||||
|
||||
Loki::Printf("\nCreating Pimpls\n");
|
||||
P1* p1 = new P1;
|
||||
P1* p1 = new P1;
|
||||
P2* p2 = new P2;
|
||||
P3* p3 = new P3;
|
||||
P4* p4 = new P4;
|
||||
P5* p5 = new P5;
|
||||
PO1* p6 = new PO1;
|
||||
PO2* p7 = new PO2;
|
||||
PO1* p6 = new PO1;
|
||||
PO2* p7 = new PO2;
|
||||
PO3* p8 = new PO3;
|
||||
PO4* p9 = new PO4;
|
||||
PO5* p10 = new PO5;
|
||||
PO4* p9 = new PO4;
|
||||
PO5* p10 = new PO5;
|
||||
|
||||
Loki::Printf("\nConst check\n");
|
||||
p1->f();
|
||||
|
@ -292,11 +292,11 @@ void test_more()
|
|||
p3->f();
|
||||
p4->f();
|
||||
p5->f();
|
||||
p6->f();
|
||||
p7->f();
|
||||
p6->f();
|
||||
p7->f();
|
||||
p8->f();
|
||||
p9->f();
|
||||
p10->f();
|
||||
p9->f();
|
||||
p10->f();
|
||||
|
||||
Loki::Printf("\nDeleting Pimpls\n");
|
||||
delete p1;
|
||||
|
@ -305,10 +305,10 @@ void test_more()
|
|||
delete p4;
|
||||
delete p5;
|
||||
delete p6;
|
||||
delete p7;
|
||||
delete p8;
|
||||
delete p9;
|
||||
delete p10;
|
||||
delete p7;
|
||||
delete p8;
|
||||
delete p9;
|
||||
delete p10;
|
||||
|
||||
|
||||
Loki::Printf("\nCreating Rimpls\n");
|
||||
|
@ -318,22 +318,22 @@ void test_more()
|
|||
R4* r4 = new R4;
|
||||
R5* r5 = new R5;
|
||||
|
||||
RO1* r6 = new RO1;
|
||||
RO1* r6 = new RO1;
|
||||
RO2* r7 = new RO2;
|
||||
RO3* r8 = new RO3;
|
||||
RO4* r9 = new RO4;
|
||||
RO5* r10 = new RO5;
|
||||
|
||||
r1->f();
|
||||
r1->f();
|
||||
r2->f();
|
||||
r3->f();
|
||||
r4->f();
|
||||
r5->f();
|
||||
r6->f();
|
||||
r7->f();
|
||||
r8->f();
|
||||
r9->f();
|
||||
r10->f();
|
||||
r7->f();
|
||||
r8->f();
|
||||
r9->f();
|
||||
r10->f();
|
||||
|
||||
Loki::Printf("\nDeleting Rimpls\n");
|
||||
delete r1;
|
||||
|
@ -342,10 +342,10 @@ void test_more()
|
|||
delete r4;
|
||||
delete r5;
|
||||
delete r6;
|
||||
delete r7;
|
||||
delete r8;
|
||||
delete r9;
|
||||
delete r10;
|
||||
delete r7;
|
||||
delete r8;
|
||||
delete r9;
|
||||
delete r10;
|
||||
|
||||
|
||||
Loki::Printf("\nCreating const Pimpls\n");
|
||||
|
@ -356,10 +356,10 @@ void test_more()
|
|||
const P5* cp5 = new P5;
|
||||
|
||||
const PO1* cp6 = new PO1;
|
||||
const PO2* cp7 = new PO2;
|
||||
const PO2* cp7 = new PO2;
|
||||
const PO3* cp8 = new PO3;
|
||||
const PO4* cp9 = new PO4;
|
||||
const PO5* cp10 = new PO5;
|
||||
const PO4* cp9 = new PO4;
|
||||
const PO5* cp10 = new PO5;
|
||||
|
||||
Loki::Printf("\nConst check\n");
|
||||
cp1->f();
|
||||
|
@ -368,10 +368,10 @@ void test_more()
|
|||
cp4->f();
|
||||
cp5->f();
|
||||
cp6->f();
|
||||
cp7->f();
|
||||
cp8->f();
|
||||
cp9->f();
|
||||
cp10->f();
|
||||
cp7->f();
|
||||
cp8->f();
|
||||
cp9->f();
|
||||
cp10->f();
|
||||
|
||||
Loki::Printf("\nDeleting const Pimpls\n");
|
||||
delete cp1;
|
||||
|
@ -379,9 +379,9 @@ void test_more()
|
|||
delete cp3;
|
||||
delete cp4;
|
||||
delete cp5;
|
||||
delete cp6;
|
||||
delete cp7;
|
||||
delete cp8;
|
||||
delete cp6;
|
||||
delete cp7;
|
||||
delete cp8;
|
||||
delete cp9;
|
||||
delete cp10;
|
||||
delete cp10;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
void foo();
|
||||
|
||||
private:
|
||||
PimplT<A>::Type d;
|
||||
PimplT<A>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -102,11 +102,11 @@ typedef std::auto_ptr<ImplT<E> > StdAutoPtr;
|
|||
|
||||
// Pimpl
|
||||
|
||||
typedef Pimpl<ImplT<E> > Pimpl1;
|
||||
typedef Pimpl<ImplT<E>, CPropPtr> Pimpl2;
|
||||
typedef Pimpl<ImplT<E>, LokiPtr> Pimpl3;
|
||||
typedef Pimpl<ImplT<E>, BoostPtr> Pimpl4;
|
||||
typedef Pimpl<ImplT<E>, StdAutoPtr> Pimpl5;
|
||||
typedef Pimpl<ImplT<E> > Pimpl1;
|
||||
typedef Pimpl<ImplT<E>, CPropPtr> Pimpl2;
|
||||
typedef Pimpl<ImplT<E>, LokiPtr> Pimpl3;
|
||||
typedef Pimpl<ImplT<E>, BoostPtr> Pimpl4;
|
||||
typedef Pimpl<ImplT<E>, StdAutoPtr> Pimpl5;
|
||||
|
||||
struct P1 {Pimpl1 d; P1();void f();void f()const;};
|
||||
struct P2 {Pimpl2 d; P2();void f();void f()const;};
|
||||
|
@ -117,10 +117,10 @@ struct P5 {Pimpl5 d; P5();void f();void f()const;};
|
|||
|
||||
// PimplOwner
|
||||
|
||||
typedef PimplOwner<ImplT<E> > PimplOwner1;
|
||||
typedef PimplOwner<ImplT<E>, CPropPtr> PimplOwner2;
|
||||
typedef PimplOwner<ImplT<E>, LokiPtr> PimplOwner3;
|
||||
typedef PimplOwner<ImplT<E>, BoostPtr> PimplOwner4;
|
||||
typedef PimplOwner<ImplT<E> > PimplOwner1;
|
||||
typedef PimplOwner<ImplT<E>, CPropPtr> PimplOwner2;
|
||||
typedef PimplOwner<ImplT<E>, LokiPtr> PimplOwner3;
|
||||
typedef PimplOwner<ImplT<E>, BoostPtr> PimplOwner4;
|
||||
typedef PimplOwner<ImplT<E>, StdAutoPtr>PimplOwner5;
|
||||
|
||||
struct PO1 : private PimplOwner1 {PO1();void f();void f()const;};
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
void foo();
|
||||
|
||||
private:
|
||||
PimplT<A2>::Type d;
|
||||
PimplT<A2>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
Incomplete1();
|
||||
void foo();
|
||||
private:
|
||||
PimplT<Incomplete1>::Type d;
|
||||
PimplT<Incomplete1>::Type d;
|
||||
};
|
||||
|
||||
class Incomplete2
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
~Incomplete2();
|
||||
void foo();
|
||||
private:
|
||||
PimplT<Incomplete2>::Type d;
|
||||
PimplT<Incomplete2>::Type d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
}
|
||||
void foo();
|
||||
private:
|
||||
PimplT<Incomplete3>::Type d;
|
||||
PimplT<Incomplete3>::Type d;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -130,5 +130,5 @@ public:
|
|||
Incomplete4();
|
||||
void foo();
|
||||
private:
|
||||
Pimpl<Impl4, std::auto_ptr<Impl4> > d;
|
||||
Pimpl<Impl4, std::auto_ptr<Impl4> > d;
|
||||
};
|
||||
|
|
|
@ -21,16 +21,16 @@
|
|||
|
||||
struct Base
|
||||
{
|
||||
virtual void foo() = 0;
|
||||
virtual ~Base();
|
||||
virtual void foo() = 0;
|
||||
virtual ~Base();
|
||||
};
|
||||
|
||||
bool registerClass(std::string, Base*(*)() );
|
||||
|
||||
typedef Loki::Seq
|
||||
<
|
||||
struct Foo,
|
||||
struct Boo
|
||||
struct Foo,
|
||||
struct Boo
|
||||
|
||||
>::Type ClassList;
|
||||
|
||||
|
|
|
@ -43,25 +43,25 @@ Base* createBoo(){ return new Boo; }
|
|||
|
||||
namespace Loki
|
||||
{
|
||||
template<> bool RegisterFunction<Foo>()
|
||||
template<> bool RegisterFunction<Foo>()
|
||||
{
|
||||
std::cout << "RegisterFunction<Foo>\n";
|
||||
return registerClass("Foo", &createFoo);
|
||||
std::cout << "RegisterFunction<Foo>\n";
|
||||
return registerClass("Foo", &createFoo);
|
||||
}
|
||||
template<> bool RegisterFunction<Boo>()
|
||||
template<> bool RegisterFunction<Boo>()
|
||||
{
|
||||
std::cout << "RegisterFunction<Boo>\n";
|
||||
return registerClass("Boo", &createBoo);
|
||||
std::cout << "RegisterFunction<Boo>\n";
|
||||
return registerClass("Boo", &createBoo);
|
||||
}
|
||||
|
||||
template<> bool UnRegisterFunction<Foo>()
|
||||
template<> bool UnRegisterFunction<Foo>()
|
||||
{
|
||||
std::cout << "UnRegisterFunction<Foo>\n";
|
||||
return true;
|
||||
std::cout << "UnRegisterFunction<Foo>\n";
|
||||
return true;
|
||||
}
|
||||
template<> bool UnRegisterFunction<Boo>()
|
||||
template<> bool UnRegisterFunction<Boo>()
|
||||
{
|
||||
std::cout << "UnRegisterFunction<Boo>\n";
|
||||
return true;
|
||||
std::cout << "UnRegisterFunction<Boo>\n";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,16 +19,16 @@
|
|||
|
||||
struct Foo : Base
|
||||
{
|
||||
Foo();
|
||||
virtual ~Foo();
|
||||
void foo();
|
||||
Foo();
|
||||
virtual ~Foo();
|
||||
void foo();
|
||||
};
|
||||
|
||||
struct Boo : Base
|
||||
{
|
||||
Boo();
|
||||
virtual ~Boo();
|
||||
void foo();
|
||||
Boo();
|
||||
virtual ~Boo();
|
||||
void foo();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
typedef Loki::SingletonHolder
|
||||
<
|
||||
Loki::Factory<Base, std::string>
|
||||
Loki::Factory<Base, std::string>
|
||||
>
|
||||
BaseFactory;
|
||||
|
||||
|
||||
bool registerClass(std::string key, Base*(*creator)() )
|
||||
{
|
||||
return BaseFactory::Instance().Register(key,creator);
|
||||
return BaseFactory::Instance().Register(key,creator);
|
||||
}
|
||||
|
||||
Loki::RegisterOnCreateSet<ClassList> registerAllClasses;
|
||||
|
@ -37,18 +37,18 @@ Loki::UnRegisterOnDeleteSet<ClassList> unregisterAllClasses;
|
|||
|
||||
int main()
|
||||
{
|
||||
Base* foo = BaseFactory::Instance().CreateObject("Foo");
|
||||
Base* boo = BaseFactory::Instance().CreateObject("Boo");
|
||||
Base* foo = BaseFactory::Instance().CreateObject("Foo");
|
||||
Base* boo = BaseFactory::Instance().CreateObject("Boo");
|
||||
|
||||
foo->foo();
|
||||
boo->foo();
|
||||
foo->foo();
|
||||
boo->foo();
|
||||
|
||||
delete foo;
|
||||
delete boo;
|
||||
delete foo;
|
||||
delete boo;
|
||||
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER)
|
||||
system("PAUSE");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
//TODO:
|
||||
// BindFirst and Chainer
|
||||
|
||||
Functor<void,Seq<bool &> > member_func(&testClass,&TestClass::member);
|
||||
Functor<void,Seq<bool &> > member_func(&testClass,&TestClass::member);
|
||||
Functor<void,Seq<bool &> > free_func(&free_function);
|
||||
Functor<void,Seq<bool &> > NULL_func;
|
||||
Functor<void,Seq<bool &> > NULL_func0;
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
&& bindFunctorCompare
|
||||
&& chainFunctorCompare;
|
||||
#else
|
||||
;
|
||||
;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
|
|
@ -86,102 +86,102 @@ public:
|
|||
|
||||
bool test1=TestClass::instances == 0;
|
||||
|
||||
{ p0 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p1 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p2 p(new TestClass); p2 pp(p); } LOKI_assert(TestClass::instances==0);
|
||||
{ p3 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p4 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p5 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p6 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p7 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p8 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p9 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p10 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p11 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p12 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p13 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p14 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p15 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p16 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p17 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p18 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p19 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p20 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p21 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p22 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p23 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p24 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p25 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p26 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p27 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p28 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p29 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p30 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p31 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p40 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p41 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p42 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p43 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p44 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p45 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p46 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p47 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p48 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p49 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p50 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p51 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p52 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p53 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p54 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p55 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p56 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p57 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p58 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p59 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p60 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p61 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p62 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p63 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p64 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p65 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p66 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p67 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p68 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p69 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p70 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p71 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p72 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p73 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p74 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p75 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p76 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p77 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p78 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p79 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p80 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p81 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p82 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p83 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p84 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p85 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p86 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p87 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p88 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p89 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p90 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p91 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p92 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p93 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p94 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p95 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p96 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p97 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p98 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p99 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p100 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p101 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p102 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p103 p(new TestClass); }
|
||||
{ p0 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p1 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p2 p(new TestClass); p2 pp(p); } LOKI_assert(TestClass::instances==0);
|
||||
{ p3 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p4 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p5 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p6 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p7 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p8 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p9 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p10 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p11 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p12 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p13 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p14 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p15 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p16 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p17 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p18 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p19 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p20 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p21 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p22 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p23 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p24 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p25 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p26 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p27 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p28 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p29 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p30 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p31 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p40 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p41 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p42 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p43 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p44 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p45 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p46 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p47 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p48 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p49 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p50 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p51 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p52 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p53 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p54 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p55 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p56 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p57 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p58 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p59 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p60 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p61 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p62 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p63 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p64 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p65 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p66 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p67 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p68 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p69 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p70 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p71 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p72 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p73 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p74 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p75 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p76 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p77 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p78 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p79 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p80 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p81 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p82 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p83 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p84 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p85 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p86 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p87 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p88 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p89 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p90 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p91 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p92 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p93 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p94 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p95 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p96 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p97 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p98 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p99 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p100 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p101 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p102 p(new TestClass); } LOKI_assert(TestClass::instances==0);
|
||||
{ p103 p(new TestClass); }
|
||||
|
||||
bool test2=TestClass::instances==0;
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@ Test for singletons in a shared libraries:
|
|||
|
||||
int main()
|
||||
{
|
||||
Foo& foo = Singleton<Foo>::Instance();
|
||||
Foo& lokifoo = Loki::Singleton<Foo>::Instance();
|
||||
foo.foo();
|
||||
lokifoo.foo();
|
||||
Foo& foo = Singleton<Foo>::Instance();
|
||||
Foo& lokifoo = Loki::Singleton<Foo>::Instance();
|
||||
foo.foo();
|
||||
lokifoo.foo();
|
||||
|
||||
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER)
|
||||
system("PAUSE");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -21,5 +21,5 @@ Foo::Foo()
|
|||
|
||||
void Foo::foo()
|
||||
{
|
||||
std::cout << "\nFoo:foo() called, this: " << this << "\n";
|
||||
std::cout << "\nFoo:foo() called, this: " << this << "\n";
|
||||
}
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
class FOO_EXPORT Foo
|
||||
{
|
||||
public:
|
||||
Foo();
|
||||
Foo();
|
||||
|
||||
void foo();
|
||||
void foo();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ typedef Loki::SingletonHolder<Foo> FooSingleton;
|
|||
LOKI_SINGLETON_INSTANCE_DEFINITION(FooSingleton)
|
||||
/*
|
||||
namespace Loki
|
||||
{
|
||||
template<>
|
||||
FooSingleton::ObjectType& Singleton<FooSingleton::ObjectType>::Instance()
|
||||
{
|
||||
{
|
||||
template<>
|
||||
FooSingleton::ObjectType& Singleton<FooSingleton::ObjectType>::Instance()
|
||||
{
|
||||
return FooSingleton::Instance();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace Loki
|
|||
template<>
|
||||
Foo& Singleton<Foo>::Instance()
|
||||
{
|
||||
return FooSingleton::Instance();
|
||||
return FooSingleton::Instance();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ template<class T>
|
|||
class Singleton
|
||||
{
|
||||
public:
|
||||
static T& Instance();
|
||||
static T& Instance();
|
||||
};
|
||||
|
||||
template class SINGLETONDLL_EXPORT Singleton<Foo>;
|
||||
|
|
|
@ -33,7 +33,7 @@ class VariableVisitor :
|
|||
//public Loki::Visitor<Base>,
|
||||
//public Loki::Visitor<Type1>
|
||||
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||
public Loki::Visitor<LOKI_TYPELIST_2(Base,Type1)>
|
||||
public Loki::Visitor<LOKI_TYPELIST_2(Base,Type1)>
|
||||
#else
|
||||
public Loki::Visitor<Loki::Seq<Base,Type1>::Type>
|
||||
#endif
|
||||
|
@ -61,7 +61,7 @@ class CVariableVisitor :
|
|||
//public Loki::Visitor<CBase,void,true>,
|
||||
//public Loki::Visitor<CType1,void,true>
|
||||
#ifndef LOKI_DISABLE_TYPELIST_MACROS
|
||||
public Loki::Visitor<LOKI_TYPELIST_2(CBase,CType1),void,true>
|
||||
public Loki::Visitor<LOKI_TYPELIST_2(CBase,CType1),void,true>
|
||||
#else
|
||||
public Loki::Visitor<Loki::Seq<CBase,CType1>::Type,void,true>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue