diff --git a/test/Pimpl/Pimpl.vcproj b/test/Pimpl/Pimpl.vcproj index 7c2fac5..2879ad8 100755 --- a/test/Pimpl/Pimpl.vcproj +++ b/test/Pimpl/Pimpl.vcproj @@ -226,18 +226,6 @@ RelativePath="..\..\include\loki\Pimpl.h" > - - - - - - diff --git a/test/Pimpl/main.cpp b/test/Pimpl/main.cpp index 04f15b7..be83ac1 100755 --- a/test/Pimpl/main.cpp +++ b/test/Pimpl/main.cpp @@ -23,8 +23,6 @@ #include "type.h" #include "type2.h" -#include - #include @@ -97,7 +95,7 @@ namespace Loki // gcc!! ///////////////////////////////////////// // class C definition ///////////////////////////////////////// -C::C() : d(rlife) +C::C() : d(rinit) {} void C::foo() @@ -208,24 +206,28 @@ P2::P2(){d->data = 2;} P3::P3(){d->data = 3;} P4::P4(){d->data = 4;} P5::P5(){d->data = 5;} +P6::P6(){d->data = 6;} R1::R1(){d.data = 11;} R2::R2(){d.data = 22;} R3::R3(){d.data = 33;} -R4::R4():d(t){d.data = 44;} -R5::R5():d(t){d.data = 55;} -R6::R6():d(t){d.data = 66;} +R4::R4():d(rinit){d.data = 44;} +R5::R5():d(rinit){d.data = 55;} +R6::R6():d(rinit){d.data = 66;} void test_more() { - Loki::Printf("\nmore tests:\n"); + Loki::Printf("\n\nMore tests:\n"); + Loki::Printf("\nCreating Pimpls\n"); P1* p1 = new P1; P2* p2 = new P2; P3* p3 = new P3; P4* p4 = new P4; P5* p5 = new P5; + P6* p6 = new P6; + Loki::Printf("\nCreating Rimpls\n"); R1* r1 = new R1; R2* r2 = new R2; R3* r3 = new R3; @@ -234,13 +236,16 @@ void test_more() R6* r6 = new R6; - delete p1; + Loki::Printf("\nDeleting Pimpls\n"); + delete p1; delete p2; delete p3; delete p4; delete p5; + delete p6; - delete r1; + Loki::Printf("\nDeleting Rimpls\n"); + delete r1; delete r2; delete r3; delete r4; diff --git a/test/Pimpl/type.h b/test/Pimpl/type.h index 090334e..8a40346 100755 --- a/test/Pimpl/type.h +++ b/test/Pimpl/type.h @@ -15,6 +15,7 @@ #include + //#define TEST_WITH_BOOST #ifdef TEST_WITH_BOOST #include @@ -64,7 +65,7 @@ public: void foo(); private: - Rimpl::Life rlife; + Rimpl::Init rinit; Rimpl::Type& d; }; @@ -146,6 +147,15 @@ typedef Loki::PtrImpl > Pimpl5; +typedef Loki::PtrImpl +< + Loki::Impl, + Loki::Impl*, + Loki::AutoDeletePimpl, + Loki::DeclaredPimpl +> +Pimpl6; + // Pimpl @@ -241,13 +251,13 @@ Pimpl8; template struct R { - typedef Loki::PimplLife + typedef Loki::Private::AutoPtrHolder < T, T*, Loki::AutoDeletePimpl > - Life; + Init; }; @@ -256,12 +266,13 @@ struct P2 : private Pimpl2 {P2();}; struct P3 : private Pimpl3 {P3();}; struct P4 {Pimpl4 d; P4();}; struct P5 {Pimpl5 d; P5();}; +struct P6 {Pimpl6 d; P6();}; struct R1 : private Rimpl1 {R1();}; struct R2 : private Rimpl2 {R2();}; struct R3 : private Rimpl3 {R3();}; -struct R4 {Rimpl4& d; R::Life t; R4();}; -struct R5 {Rimpl5& d; R::Life t; R5();}; -struct R6 {Rimpl6& d; R::Life t; R6();}; +struct R4 {Rimpl4& d; R::Init rinit; R4();}; +struct R5 {Rimpl5& d; R::Init rinit; R5();}; +struct R6 {Rimpl6& d; R::Init rinit; R6();}; diff --git a/test/Pimpl/type2.h b/test/Pimpl/type2.h index 05e4355..75bae2c 100755 --- a/test/Pimpl/type2.h +++ b/test/Pimpl/type2.h @@ -30,7 +30,7 @@ public: void foo(); private: - Pimpl::Type d; + Pimpl::Type d; }; @@ -57,7 +57,7 @@ public: void foo(); private: - Rimpl::Life rlife; + Rimpl::Init rint; Rimpl::Type& d; };