From d72b2ff1b32973a5cadf14be1f95c8792fecbfb3 Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Wed, 8 Mar 2006 17:07:20 +0000 Subject: [PATCH] replace tabs with 4 spaces in all files git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@600 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/LokiExport.h | 4 +- include/loki/Pimpl.h | 159 ++++---- include/loki/RefToValue.h | 2 +- include/loki/Register.h | 144 +++---- include/loki/SmallObj.h | 17 +- include/loki/SmartPtr.h | 7 +- include/loki/flex/allocatorstringstorage.h | 8 +- include/loki/flex/flex_string_details.h | 14 +- include/loki/flex/flex_string_shell.h | 444 ++++++++++----------- include/loki/flex/simplestringstorage.h | 14 +- include/loki/flex/smallstringopt.h | 12 +- include/loki/flex/vectorstringstorage.h | 40 +- include/loki/yasli/yasli_fill_iterator.h | 162 ++++---- include/loki/yasli/yasli_traits.h | 2 +- include/loki/yasli/yasli_vector.h | 4 +- test/Pimpl/main.cpp | 2 +- test/Pimpl/type.h | 4 +- test/Pimpl/type2.h | 18 +- test/Register/foo.cpp | 32 +- test/Register/main.cpp | 2 +- test/SingletonDll/foo_export.h | 4 +- test/SingletonDll/singletondll_export.h | 4 +- 22 files changed, 554 insertions(+), 545 deletions(-) diff --git a/include/loki/LokiExport.h b/include/loki/LokiExport.h index abed17d..350c7f7 100755 --- a/include/loki/LokiExport.h +++ b/include/loki/LokiExport.h @@ -40,8 +40,8 @@ #if (defined(LOKI_MAKE_DLL) && defined(LOKI_DLL)) || \ - (defined(LOKI_MAKE_DLL) && defined(LOKI_STATIC)) || \ - (defined(LOKI_DLL) && defined(LOKI_STATIC)) + (defined(LOKI_MAKE_DLL) && defined(LOKI_STATIC)) || \ + (defined(LOKI_DLL) && defined(LOKI_STATIC)) #error export macro error: you could not build AND use the library #endif diff --git a/include/loki/Pimpl.h b/include/loki/Pimpl.h index 7e3234c..6953f8a 100755 --- a/include/loki/Pimpl.h +++ b/include/loki/Pimpl.h @@ -27,73 +27,73 @@ namespace Loki { - ////////////////////////////////////////// - /// \class ConstPropPtr - /// - /// \ingroup PimplGroup + ////////////////////////////////////////// + /// \class ConstPropPtr + /// + /// \ingroup PimplGroup /// Simple const propagating smart pointer - /// Is the default smart pointer of Pimpl. + /// Is the default smart pointer of Pimpl. ////////////////////////////////////////// template struct ConstPropPtr - { - explicit ConstPropPtr(T* p) : ptr_(p) {} - ~ConstPropPtr() { delete ptr_; ptr_ = 0; } - T* operator->() { return ptr_; } - T& operator*() { return *ptr_; } - const T* operator->() const { return ptr_; } - const T& operator*() const { return *ptr_; } - + { + explicit ConstPropPtr(T* p) : ptr_(p) {} + ~ConstPropPtr() { delete ptr_; ptr_ = 0; } + T* operator->() { return ptr_; } + T& operator*() { return *ptr_; } + const T* operator->() const { return ptr_; } + const T& operator*() const { return *ptr_; } + private: - ConstPropPtr(); - ConstPropPtr(const ConstPropPtr&); - ConstPropPtr& operator=(const ConstPropPtr&); - T* ptr_; - }; + ConstPropPtr(); + ConstPropPtr(const ConstPropPtr&); + ConstPropPtr& operator=(const ConstPropPtr&); + T* ptr_; + }; - //////////////////////////////////////////////////////////////////////////////// - /// \class Pimpl - /// - /// \ingroup PimplGroup - /// - /// Implements the Pimpl idiom. It's a wrapper for a smart pointer which - /// automatically creates and deletes the implementation object and adds - /// const propagation to the smart pointer. - /// - /// \par Usage - /// see test/Pimpl - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// \class Pimpl + /// + /// \ingroup PimplGroup + /// + /// Implements the Pimpl idiom. It's a wrapper for a smart pointer which + /// automatically creates and deletes the implementation object and adds + /// const propagation to the smart pointer. + /// + /// \par Usage + /// see test/Pimpl + //////////////////////////////////////////////////////////////////////////////// template - < - class T, - typename Pointer = ConstPropPtr - > + < + class T, + typename Pointer = ConstPropPtr + > class Pimpl - { + { public: - typedef T Impl; + typedef T Impl; - Pimpl() : ptr_(new T) + Pimpl() : ptr_(new T) {} - ~Pimpl() + ~Pimpl() { - // Don't compile with incomplete type - // - // If compilation brakes here make sure - // the compiler does not auto-generate the - // destructor of the class hosting the pimpl: - // - implement the destructor of the class - // - don't inline the destructor - typedef char T_must_be_defined[sizeof(T) ? 1 : -1 ]; - } + // Don't compile with incomplete type + // + // If compilation brakes here make sure + // the compiler does not auto-generate the + // destructor of the class hosting the pimpl: + // - implement the destructor of the class + // - don't inline the destructor + typedef char T_must_be_defined[sizeof(T) ? 1 : -1 ]; + } - T* operator->() + T* operator->() { return ptr_.operator->(); } @@ -113,22 +113,22 @@ namespace Loki return ptr_.operator*(); } - Pointer& wrapped() - { - return ptr_; - } + Pointer& wrapped() + { + return ptr_; + } - const Pointer& wrapped() const - { - return ptr_; - } + const Pointer& wrapped() const + { + return ptr_; + } private: - Pimpl(const Pimpl&); + Pimpl(const Pimpl&); Pimpl& operator=(const Pimpl&); - Pointer ptr_; + Pointer ptr_; }; @@ -139,55 +139,55 @@ namespace Loki }; - ////////////////////////////////////////// + ////////////////////////////////////////// /// \class ImplT - /// - /// \ingroup PimplGroup - /// Convenience template for the - /// implementations which PimplT points to. + /// + /// \ingroup PimplGroup + /// Convenience template for the + /// implementations which PimplT points to. ////////////////////////////////////////// template struct ImplT; - ////////////////////////////////////////// + ////////////////////////////////////////// /// \class PImplT - /// - /// \ingroup PimplGroup - /// Convenience template which uses ImplT - /// as implementation structure + /// + /// \ingroup PimplGroup + /// Convenience template which uses ImplT + /// as implementation structure ////////////////////////////////////////// template class Ptr = ConstPropPtr> struct PimplT { - typedef T Impl; + typedef T Impl; // declare pimpl typedef Pimpl, Ptr > > Type; // inherit pimpl typedef PimplOwner, Ptr > > Owner; - }; + }; template::Type > struct RimplT { - typedef typename UsedPimpl::Impl & Type; + typedef typename UsedPimpl::Impl & Type; class Owner - { - UsedPimpl pimpl; + { + UsedPimpl pimpl; - public: - Owner() : LOKI_INHERITED_RIMPL_NAME(*pimpl) - {} + public: + Owner() : LOKI_INHERITED_RIMPL_NAME(*pimpl) + {} - Type LOKI_INHERITED_RIMPL_NAME; - }; + Type LOKI_INHERITED_RIMPL_NAME; + }; }; @@ -196,6 +196,9 @@ namespace Loki #endif // $Log$ +// Revision 1.19 2006/03/08 17:07:11 syntheticpp +// replace tabs with 4 spaces in all files +// // Revision 1.18 2006/03/08 16:39:27 syntheticpp // add documenation // diff --git a/include/loki/RefToValue.h b/include/loki/RefToValue.h index 8e6ec8f..94df4d4 100755 --- a/include/loki/RefToValue.h +++ b/include/loki/RefToValue.h @@ -49,7 +49,7 @@ namespace Loki }; - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// /// \function ByRef /// /// \ingroup ExceptionGroup diff --git a/include/loki/Register.h b/include/loki/Register.h index 34a326d..f14fc10 100755 --- a/include/loki/Register.h +++ b/include/loki/Register.h @@ -22,98 +22,98 @@ namespace Loki { - //////////////////////////////////////////////////////////////////////////////// - // - // Helper classes/functions for RegisterByCreateSet - // - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + // + // Helper classes/functions for RegisterByCreateSet + // + //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// - /// \ingroup Register - /// Must be specialized be the user - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// \ingroup Register + /// Must be specialized be the user + //////////////////////////////////////////////////////////////////////////////// template bool RegisterFunction(); - //////////////////////////////////////////////////////////////////////////////// - /// \ingroup Register - /// Must be specialized be the user - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// \ingroup Register + /// Must be specialized be the user + //////////////////////////////////////////////////////////////////////////////// template bool UnRegisterFunction(); namespace Private - { - template - struct RegisterOnCreate - { - RegisterOnCreate() { RegisterFunction(); } - }; + { + template + struct RegisterOnCreate + { + RegisterOnCreate() { RegisterFunction(); } + }; - template - struct UnRegisterOnDelete - { - ~UnRegisterOnDelete() { UnRegisterFunction(); } - }; + template + struct UnRegisterOnDelete + { + ~UnRegisterOnDelete() { UnRegisterFunction(); } + }; - template - struct RegisterOnCreateElement - { - RegisterOnCreate registerObj; - }; + template + struct RegisterOnCreateElement + { + RegisterOnCreate registerObj; + }; - template - struct UnRegisterOnDeleteElement - { - UnRegisterOnDelete unregisterObj; - }; - } + template + struct UnRegisterOnDeleteElement + { + UnRegisterOnDelete unregisterObj; + }; + } - //////////////////////////////////////////////////////////////////////////////// - /// \class RegisterOnCreateSet - /// - /// \ingroup Register - /// Implements a generic register class which registers classes of a typelist - /// - /// \par Usage - /// see test/Register - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// \class RegisterOnCreateSet + /// + /// \ingroup Register + /// Implements a generic register class which registers classes of a typelist + /// + /// \par Usage + /// see test/Register + //////////////////////////////////////////////////////////////////////////////// template struct RegisterOnCreateSet - : GenScatterHierarchy - {}; + : GenScatterHierarchy + {}; - //////////////////////////////////////////////////////////////////////////////// - /// \class UnRegisterOnDeleteSet - /// - /// \ingroup Register - /// Implements a generic register class which unregisters classes of a typelist - /// - /// \par Usage - /// see test/Register - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// \class UnRegisterOnDeleteSet + /// + /// \ingroup Register + /// Implements a generic register class which unregisters classes of a typelist + /// + /// \par Usage + /// see test/Register + //////////////////////////////////////////////////////////////////////////////// template struct UnRegisterOnDeleteSet - : GenScatterHierarchy - {}; + : GenScatterHierarchy + {}; - //////////////////////////////////////////////////////////////////////////////// - /// \def LOKI_CHECK_CLASS_IN_LIST( CLASS , LIST ) - /// - /// \ingroup Register - /// Check if CLASS is in the typelist LIST. - /// - /// \par Usage - /// see test/Register - //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /// \def LOKI_CHECK_CLASS_IN_LIST( CLASS , LIST ) + /// + /// \ingroup Register + /// Check if CLASS is in the typelist LIST. + /// + /// \par Usage + /// see test/Register + //////////////////////////////////////////////////////////////////////////////// -#define LOKI_CHECK_CLASS_IN_LIST( CLASS , LIST ) \ - \ +#define LOKI_CHECK_CLASS_IN_LIST( CLASS , LIST ) \ + \ struct Loki_##CLASS##LIST_OK{typedef int class_##CLASS##_is_not_in_##LIST;};\ - typedef Loki::Select::value == -1, \ - CLASS,Loki_##CLASS##LIST_OK >::Result IsInList##CLASS##LIST; \ - typedef IsInList##CLASS##LIST::class_##CLASS##_is_not_in_##LIST \ - isInListTest##CLASS##LIST; + typedef Loki::Select::value == -1, \ + CLASS,Loki_##CLASS##LIST_OK >::Result IsInList##CLASS##LIST; \ + typedef IsInList##CLASS##LIST::class_##CLASS##_is_not_in_##LIST \ + isInListTest##CLASS##LIST; } // namespace Loki diff --git a/include/loki/SmallObj.h b/include/loki/SmallObj.h index 00684db..fefdd49 100644 --- a/include/loki/SmallObj.h +++ b/include/loki/SmallObj.h @@ -218,7 +218,7 @@ namespace Loki std::size_t maxSmallObjectSize = LOKI_MAX_SMALL_OBJECT_SIZE, std::size_t objectAlignSize = LOKI_DEFAULT_OBJECT_ALIGNMENT, template class LifetimePolicy = LOKI_DEFAULT_SMALLOBJ_LIFETIME, - class MutexPolicy = LOKI_DEFAULT_MUTEX + class MutexPolicy = LOKI_DEFAULT_MUTEX > class AllocatorSingleton : public SmallObjAllocator { @@ -283,7 +283,7 @@ namespace Loki std::size_t MSOS, std::size_t OAS, template class LP, - class MX + class MX > void AllocatorSingleton< TM, CS, MSOS, OAS, LP, MX >::ClearExtraMemory( void ) { @@ -299,7 +299,7 @@ namespace Loki std::size_t MSOS, std::size_t OAS, template class LP, - class MX + class MX > bool AllocatorSingleton< TM, CS, MSOS, OAS, LP, MX >::IsCorrupted( void ) { @@ -327,7 +327,7 @@ namespace Loki std::size_t MSOS, std::size_t OAS, template class LP, - class MX + class MX > inline unsigned int GetLongevity( AllocatorSingleton< TM, CS, MSOS, OAS, LP, MX > * ) @@ -421,7 +421,7 @@ namespace Loki std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template class LifetimePolicy, - class MutexPolicy + class MutexPolicy > class SmallObjectBase { @@ -578,7 +578,7 @@ namespace Loki std::size_t maxSmallObjectSize = LOKI_MAX_SMALL_OBJECT_SIZE, std::size_t objectAlignSize = LOKI_DEFAULT_OBJECT_ALIGNMENT, template class LifetimePolicy = LOKI_DEFAULT_SMALLOBJ_LIFETIME, - class MutexPolicy = LOKI_DEFAULT_MUTEX + class MutexPolicy = LOKI_DEFAULT_MUTEX > class SmallObject : public SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > @@ -614,7 +614,7 @@ namespace Loki std::size_t maxSmallObjectSize = LOKI_MAX_SMALL_OBJECT_SIZE, std::size_t objectAlignSize = LOKI_DEFAULT_OBJECT_ALIGNMENT, template class LifetimePolicy = LOKI_DEFAULT_SMALLOBJ_LIFETIME, - class MutexPolicy = LOKI_DEFAULT_MUTEX + class MutexPolicy = LOKI_DEFAULT_MUTEX > class SmallValueObject : public SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > @@ -634,6 +634,9 @@ namespace Loki // Nov. 26, 2004: re-implemented by Rich Sposato. // // $Log$ +// Revision 1.29 2006/03/08 17:07:11 syntheticpp +// replace tabs with 4 spaces in all files +// // Revision 1.28 2006/02/27 19:59:20 syntheticpp // add support of loki.dll // diff --git a/include/loki/SmartPtr.h b/include/loki/SmartPtr.h index a29f974..795231b 100644 --- a/include/loki/SmartPtr.h +++ b/include/loki/SmartPtr.h @@ -793,7 +793,7 @@ namespace Loki class ConversionPolicy = DisallowConversion, template class CheckingPolicy = AssertCheck, template class StoragePolicy = DefaultSPStorage, - template class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS + template class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS > struct SmartPtrDef { @@ -804,7 +804,7 @@ namespace Loki ConversionPolicy, CheckingPolicy, StoragePolicy, - ConstnessPolicy + ConstnessPolicy > type; }; @@ -1362,6 +1362,9 @@ namespace std #endif // SMARTPTR_INC_ // $Log$ +// Revision 1.24 2006/03/08 17:07:11 syntheticpp +// replace tabs with 4 spaces in all files +// // Revision 1.23 2006/02/28 16:55:56 syntheticpp // undo disabling checking, remove warnings, many thanks to Sam Miller // diff --git a/include/loki/flex/allocatorstringstorage.h b/include/loki/flex/allocatorstringstorage.h index ad4f298..8e6a6bf 100755 --- a/include/loki/flex/allocatorstringstorage.h +++ b/include/loki/flex/allocatorstringstorage.h @@ -234,9 +234,9 @@ public: template void append(ForwardIterator b, ForwardIterator e) { - const size_type - sz = std::distance(b, e), - neededCapacity = size() + sz; + const size_type + sz = std::distance(b, e), + neededCapacity = size() + sz; if (capacity() < neededCapacity) { @@ -245,7 +245,7 @@ public: assert(!(le(begin(), &*b) && le(&*b, end()))); reserve(neededCapacity); } - std::copy(b, e, end()); + std::copy(b, e, end()); pData_->pEnd_ += sz; } diff --git a/include/loki/flex/flex_string_details.h b/include/loki/flex/flex_string_details.h index b754bba..1db0adb 100755 --- a/include/loki/flex/flex_string_details.h +++ b/include/loki/flex/flex_string_details.h @@ -19,13 +19,13 @@ namespace flex_string_details { template OutIt copy_n(InIt b, typename std::iterator_traits::difference_type n, OutIt d) - { - for (; n != 0; --n, ++b, ++d) - { - *d = *b; - } - return d; - } + { + for (; n != 0; --n, ++b, ++d) + { + *d = *b; + } + return d; + } template inline void pod_fill(Pod* b, Pod* e, T c) diff --git a/include/loki/flex/flex_string_shell.h b/include/loki/flex/flex_string_shell.h index 34f1f0f..c7a84f5 100755 --- a/include/loki/flex/flex_string_shell.h +++ b/include/loki/flex/flex_string_shell.h @@ -170,7 +170,7 @@ class flex_string : private Storage struct Invariant { #ifndef NDEBUG - Invariant(const flex_string& s) : s_(s) + Invariant(const flex_string& s) : s_(s) { assert(s_.Sane()); } @@ -181,7 +181,7 @@ class flex_string : private Storage private: const flex_string& s_; #else - Invariant(const flex_string&) {} + Invariant(const flex_string&) {} #endif Invariant& operator=(const Invariant&); }; @@ -218,7 +218,7 @@ private: static size_type Min(size_type lhs, size_type rhs) { return lhs < rhs ? lhs : rhs; } static void Procust(size_type& n, size_type nmax) - { if (n > nmax) n = nmax; } + { if (n > nmax) n = nmax; } public: // 21.3.1 construct/copy/destroy @@ -362,7 +362,7 @@ public: flex_string& operator+=(const value_type c) { - push_back(c); + push_back(c); return *this; } @@ -374,21 +374,21 @@ public: { const size_type sz = str.size(); Enforce(pos <= sz, static_cast(0), ""); - Procust(n, sz - pos); + Procust(n, sz - pos); return append(str.data() + pos, n); } flex_string& append(const value_type* s, const size_type n) { - Invariant checker(*this); - (void) checker; + Invariant checker(*this); + (void) checker; static std::less_equal le; - if (le(&*begin(), s) && le(s, &*end())) // aliasing - { - const size_type offset = s - &*begin(); - Storage::reserve(size() + n); - s = &*begin() + offset; - } + if (le(&*begin(), s) && le(s, &*end())) // aliasing + { + const size_type offset = s - &*begin(); + Storage::reserve(size() + n); + s = &*begin() + offset; + } Storage::append(s, s + n); return *this; } @@ -405,7 +405,7 @@ public: template flex_string& append(InputIterator first, InputIterator last) { - insert(end(), first, last); + insert(end(), first, last); return *this; } @@ -416,7 +416,7 @@ public: { reserve(cap << 1u); } - Storage::append(&c, &c + 1); + Storage::append(&c, &c + 1); } flex_string& assign(const flex_string& str) @@ -428,25 +428,25 @@ public: flex_string& assign(const flex_string& str, const size_type pos, size_type n) { - const size_type sz = str.size(); + const size_type sz = str.size(); Enforce(pos <= sz, static_cast(0), ""); - Procust(n, sz - pos); + Procust(n, sz - pos); return assign(str.data() + pos, n); } flex_string& assign(const value_type* s, const size_type n) { - Invariant checker(*this); - (void) checker; + Invariant checker(*this); + (void) checker; if (size() >= n) { - std::copy(s, s + n, begin()); + std::copy(s, s + n, begin()); resize(n); } else { - const value_type *const s2 = s + size(); - std::copy(s, s2, begin()); + const value_type *const s2 = s + size(); + std::copy(s, s2, begin()); append(s2, n - size()); } return *this; @@ -466,16 +466,16 @@ public: size_type pos2, size_type n) { Enforce(pos2 <= str.length(), static_cast(0), ""); - Procust(n, str.length() - pos2); - return insert(pos1, str.data() + pos2, n); - } + Procust(n, str.length() - pos2); + return insert(pos1, str.data() + pos2, n); + } flex_string& insert(size_type pos, const value_type* s, size_type n) { Enforce(pos <= length(), static_cast(0), ""); - insert(begin() + pos, s, s + n); - return *this; - } + insert(begin() + pos, s, s + n); + return *this; + } flex_string& insert(size_type pos, const value_type* s) { return insert(pos, s, traits_type::length(s)); } @@ -483,13 +483,13 @@ public: flex_string& insert(size_type pos, size_type n, value_type c) { Enforce(pos <= length(), static_cast(0), ""); - insert(begin() + pos, n, c); - return *this; - } + insert(begin() + pos, n, c); + return *this; + } iterator insert(const iterator p, const value_type c) { - const size_type pos = p - begin(); + const size_type pos = p - begin(); insert(p, 1, c); return begin() + pos; } @@ -500,122 +500,122 @@ private: flex_string& InsertImplDiscr(iterator p, size_type n, value_type c, Selector<1>) { - Invariant checker(*this); - (void) checker; - assert(p >= begin() && p <= end()); - if (capacity() - size() < n) - { - const size_type sz = p - begin(); - reserve(size() + n); - p = begin() + sz; - } - const iterator oldEnd = end(); - //if (p + n < oldEnd) // replaced because of crash (pk) - if( n < size_type(oldEnd - p)) - { - append(oldEnd - n, oldEnd); - //std::copy( - // reverse_iterator(oldEnd - n), - // reverse_iterator(p), - // reverse_iterator(oldEnd)); - flex_string_details::pod_move(&*p, &*oldEnd - n, &*p + n); - std::fill(p, p + n, c); - } - else - { - append(n - (end() - p), c); - append(p, oldEnd); - std::fill(p, oldEnd, c); - } - return *this; + Invariant checker(*this); + (void) checker; + assert(p >= begin() && p <= end()); + if (capacity() - size() < n) + { + const size_type sz = p - begin(); + reserve(size() + n); + p = begin() + sz; + } + const iterator oldEnd = end(); + //if (p + n < oldEnd) // replaced because of crash (pk) + if( n < size_type(oldEnd - p)) + { + append(oldEnd - n, oldEnd); + //std::copy( + // reverse_iterator(oldEnd - n), + // reverse_iterator(p), + // reverse_iterator(oldEnd)); + flex_string_details::pod_move(&*p, &*oldEnd - n, &*p + n); + std::fill(p, p + n, c); + } + else + { + append(n - (end() - p), c); + append(p, oldEnd); + std::fill(p, oldEnd, c); + } + return *this; } template flex_string& InsertImplDiscr(iterator i, InputIterator b, InputIterator e, Selector<0>) { - InsertImpl(i, b, e, - typename std::iterator_traits::iterator_category()); + InsertImpl(i, b, e, + typename std::iterator_traits::iterator_category()); return *this; } template void InsertImpl(iterator i, - FwdIterator s1, FwdIterator s2, std::forward_iterator_tag) + FwdIterator s1, FwdIterator s2, std::forward_iterator_tag) { - Invariant checker(*this); - (void) checker; - const size_type pos = i - begin(); - const typename std::iterator_traits::difference_type n2 = - std::distance(s1, s2); - assert(n2 >= 0); + Invariant checker(*this); + (void) checker; + const size_type pos = i - begin(); + const typename std::iterator_traits::difference_type n2 = + std::distance(s1, s2); + assert(n2 >= 0); using namespace flex_string_details; assert(pos <= size()); - const typename std::iterator_traits::difference_type maxn2 = - capacity() - size(); + const typename std::iterator_traits::difference_type maxn2 = + capacity() - size(); if (maxn2 < n2) { // realloc the string - static const std::less_equal le = - std::less_equal(); - assert(!(le(&*begin(), &*s1) && le(&*s1, &*end()))); + static const std::less_equal le = + std::less_equal(); + assert(!(le(&*begin(), &*s1) && le(&*s1, &*end()))); reserve(size() + n2); - i = begin() + pos; + i = begin() + pos; + } + if (pos + n2 <= size()) + { + //const iterator oldEnd = end(); + //Storage::append(oldEnd - n2, n2); + //std::copy(i, oldEnd - n2, i + n2); + const iterator tailBegin = end() - n2; + Storage::append(tailBegin, tailBegin + n2); + //std::copy(i, tailBegin, i + n2); + std::copy(reverse_iterator(tailBegin), reverse_iterator(i), + reverse_iterator(tailBegin + n2)); + std::copy(s1, s2, i); + } + else + { + FwdIterator t = s1; + const size_type old_size = size(); + std::advance(t, old_size - pos); + assert(std::distance(t, s2) >= 0); + Storage::append(t, s2); + Storage::append(data() + pos, data() + old_size); + std::copy(s1, t, i); } - if (pos + n2 <= size()) - { - //const iterator oldEnd = end(); - //Storage::append(oldEnd - n2, n2); - //std::copy(i, oldEnd - n2, i + n2); - const iterator tailBegin = end() - n2; - Storage::append(tailBegin, tailBegin + n2); - //std::copy(i, tailBegin, i + n2); - std::copy(reverse_iterator(tailBegin), reverse_iterator(i), - reverse_iterator(tailBegin + n2)); - std::copy(s1, s2, i); - } - else - { - FwdIterator t = s1; - const size_type old_size = size(); - std::advance(t, old_size - pos); - assert(std::distance(t, s2) >= 0); - Storage::append(t, s2); - Storage::append(data() + pos, data() + old_size); - std::copy(s1, t, i); - } } template void InsertImpl(iterator i1, iterator i2, - InputIterator b, InputIterator e, std::input_iterator_tag) + InputIterator b, InputIterator e, std::input_iterator_tag) { - flex_string temp(begin(), i1); + flex_string temp(begin(), i1); for (; b != e; ++b) - { - temp.push_back(*b); - } - temp.append(i2, end()); - swap(temp); + { + temp.push_back(*b); + } + temp.append(i2, end()); + swap(temp); } public: template void insert(iterator p, ItOrLength first_or_n, ItOrChar last_or_c) { - Selector::is_specialized> sel; - InsertImplDiscr(p, first_or_n, last_or_c, sel); - } + Selector::is_specialized> sel; + InsertImplDiscr(p, first_or_n, last_or_c, sel); + } flex_string& erase(size_type pos = 0, size_type n = npos) { - Invariant checker(*this); - (void) checker; + Invariant checker(*this); + (void) checker; Enforce(pos <= length(), static_cast(0), ""); - Procust(n, length() - pos); - std::copy(begin() + pos + n, end(), begin() + pos); - resize(length() - n); + Procust(n, length() - pos); + std::copy(begin() + pos + n, end(), begin() + pos); + resize(length() - n); return *this; } @@ -633,12 +633,12 @@ public: return begin() + pos; } - // Replaces at most n1 chars of *this, starting with pos1 with the content of str + // Replaces at most n1 chars of *this, starting with pos1 with the content of str flex_string& replace(size_type pos1, size_type n1, const flex_string& str) { return replace(pos1, n1, str.data(), str.size()); } - // Replaces at most n1 chars of *this, starting with pos1, - // with at most n2 chars of str starting with pos2 + // Replaces at most n1 chars of *this, starting with pos1, + // with at most n2 chars of str starting with pos2 flex_string& replace(size_type pos1, size_type n1, const flex_string& str, size_type pos2, size_type n2) { @@ -648,34 +648,34 @@ public: } /* - // Replaces at most n1 chars of *this, starting with pos, - // with at most n2 chars of str. - // str must have at least n2 chars. + // Replaces at most n1 chars of *this, starting with pos, + // with at most n2 chars of str. + // str must have at least n2 chars. flex_string& replace(const size_type pos, size_type n1, - const value_type* s1, const size_type n2) + const value_type* s1, const size_type n2) { - Invariant checker(*this); - (void) checker; + Invariant checker(*this); + (void) checker; Enforce(pos <= size(), (std::out_of_range*)0, ""); Procust(n1, size() - pos); - const iterator b = begin() + pos; - return replace(b, b + n1, s1, s1 + n2); + const iterator b = begin() + pos; + return replace(b, b + n1, s1, s1 + n2); using namespace flex_string_details; const int delta = int(n2 - n1); static const std::less_equal le; const bool aliased = le(&*begin(), s1) && le(s1, &*end()); - // From here on we're dealing with an aliased replace - if (delta <= 0) - { - // simple case, we're shrinking + // From here on we're dealing with an aliased replace + if (delta <= 0) + { + // simple case, we're shrinking pod_move(s1, s1 + n2, &*begin() + pos); pod_move(&*begin() + pos + n1, &*end(), &*begin() + pos + n1 + delta); resize(size() + delta); - return *this; - } + return *this; + } - // From here on we deal with aliased growth + // From here on we deal with aliased growth if (capacity() < size() + delta) { // realloc the string @@ -726,25 +726,25 @@ public: } */ - // Replaces at most n1 chars of *this, starting with pos, with chars from s + // Replaces at most n1 chars of *this, starting with pos, with chars from s flex_string& replace(size_type pos, size_type n1, const value_type* s) { return replace(pos, n1, s, traits_type::length(s)); } - // Replaces at most n1 chars of *this, starting with pos, with n2 occurences of c - // consolidated with - // Replaces at most n1 chars of *this, starting with pos, - // with at most n2 chars of str. - // str must have at least n2 chars. + // Replaces at most n1 chars of *this, starting with pos, with n2 occurences of c + // consolidated with + // Replaces at most n1 chars of *this, starting with pos, + // with at most n2 chars of str. + // str must have at least n2 chars. template flex_string& replace(size_type pos, size_type n1, - StrOrLength s_or_n2, NumOrChar n_or_c) + StrOrLength s_or_n2, NumOrChar n_or_c) { - Invariant checker(*this); - (void) checker; - Enforce(pos <= size(), static_cast(0), ""); - Procust(n1, length() - pos); - const iterator b = begin() + pos; - return replace(b, b + n1, s_or_n2, n_or_c); + Invariant checker(*this); + (void) checker; + Enforce(pos <= size(), static_cast(0), ""); + Procust(n1, length() - pos); + const iterator b = begin() + pos; + return replace(b, b + n1, s_or_n2, n_or_c); } flex_string& replace(iterator i1, iterator i2, const flex_string& str) @@ -757,26 +757,26 @@ private: flex_string& ReplaceImplDiscr(iterator i1, iterator i2, const value_type* s, size_type n, Selector<2>) { - assert(i1 <= i2); - assert(begin() <= i1 && i1 <= end()); - assert(begin() <= i2 && i2 <= end()); - return replace(i1, i2, s, s + n); - } + assert(i1 <= i2); + assert(begin() <= i1 && i1 <= end()); + assert(begin() <= i2 && i2 <= end()); + return replace(i1, i2, s, s + n); + } flex_string& ReplaceImplDiscr(iterator i1, iterator i2, size_type n2, value_type c, Selector<1>) { - const size_type n1 = i2 - i1; - if (n1 > n2) - { - std::fill(i1, i1 + n2, c); - erase(i1 + n2, i2); - } - else - { - std::fill(i1, i2, c); - insert(i2, n2 - n1, c); - } + const size_type n1 = i2 - i1; + if (n1 > n2) + { + std::fill(i1, i1 + n2, c); + erase(i1 + n2, i2); + } + else + { + std::fill(i1, i2, c); + insert(i2, n2 - n1, c); + } return *this; } @@ -784,60 +784,60 @@ private: flex_string& ReplaceImplDiscr(iterator i1, iterator i2, InputIterator b, InputIterator e, Selector<0>) { - ReplaceImpl(i1, i2, b, e, - typename std::iterator_traits::iterator_category()); + ReplaceImpl(i1, i2, b, e, + typename std::iterator_traits::iterator_category()); return *this; } template void ReplaceImpl(iterator i1, iterator i2, - FwdIterator s1, FwdIterator s2, std::forward_iterator_tag) + FwdIterator s1, FwdIterator s2, std::forward_iterator_tag) { - Invariant checker(*this); - (void) checker; - const typename std::iterator_traits::difference_type n1 = - i2 - i1; - assert(n1 >= 0); - const typename std::iterator_traits::difference_type n2 = - std::distance(s1, s2); - assert(n2 >= 0); + Invariant checker(*this); + (void) checker; + const typename std::iterator_traits::difference_type n1 = + i2 - i1; + assert(n1 >= 0); + const typename std::iterator_traits::difference_type n2 = + std::distance(s1, s2); + assert(n2 >= 0); - // Handle aliased replace + // Handle aliased replace static const std::less_equal le = - std::less_equal(); + std::less_equal(); const bool aliased = le(&*begin(), &*s1) && le(&*s1, &*end()); - if (aliased /* && capacity() < size() - n1 + n2 */) - { - // Aliased replace, copy to new string - flex_string temp; - temp.reserve(size() - n1 + n2); - temp.append(begin(), i1).append(s1, s2).append(i2, end()); - swap(temp); - return; - } + if (aliased /* && capacity() < size() - n1 + n2 */) + { + // Aliased replace, copy to new string + flex_string temp; + temp.reserve(size() - n1 + n2); + temp.append(begin(), i1).append(s1, s2).append(i2, end()); + swap(temp); + return; + } - if (n1 > n2) - { - // shrinks - std::copy(s1, s2, i1); - erase(i1 + n2, i2); - } - else - { - // grows - flex_string_details::copy_n(s1, n1, i1); - std::advance(s1, n1); - insert(i2, s1, s2); - } + if (n1 > n2) + { + // shrinks + std::copy(s1, s2, i1); + erase(i1 + n2, i2); + } + else + { + // grows + flex_string_details::copy_n(s1, n1, i1); + std::advance(s1, n1); + insert(i2, s1, s2); + } } template void ReplaceImpl(iterator i1, iterator i2, - InputIterator b, InputIterator e, std::input_iterator_tag) + InputIterator b, InputIterator e, std::input_iterator_tag) { - flex_string temp(begin(), i1); - temp.append(b, e).append(i2, end()); - swap(temp); + flex_string temp(begin(), i1); + temp.append(b, e).append(i2, end()); + swap(temp); } public: @@ -845,11 +845,11 @@ public: flex_string& replace(iterator i1, iterator i2, T1 first_or_n_or_s, T2 last_or_c_or_n) { - const bool - num1 = std::numeric_limits::is_specialized, - num2 = std::numeric_limits::is_specialized; + const bool + num1 = std::numeric_limits::is_specialized, + num2 = std::numeric_limits::is_specialized; return ReplaceImplDiscr(i1, i2, first_or_n_or_s, last_or_c_or_n, - Selector()); + Selector()); } size_type copy(value_type* s, size_type n, size_type pos = 0) const @@ -1051,36 +1051,36 @@ public: } int compare(const flex_string& str) const - { - // FIX due to Goncalo N M de Carvalho July 18, 2005 - return compare(0, size(), str); - } + { + // FIX due to Goncalo N M de Carvalho July 18, 2005 + return compare(0, size(), str); + } int compare(size_type pos1, size_type n1, const flex_string& str) const { return compare(pos1, n1, str.data(), str.size()); } - // FIX to compare: added the TC - // (http://www.comeaucomputing.com/iso/lwg-defects.html number 5) - // Thanks to Caleb Epstein for the fix + // FIX to compare: added the TC + // (http://www.comeaucomputing.com/iso/lwg-defects.html number 5) + // Thanks to Caleb Epstein for the fix int compare(size_type pos1, size_type n1, const value_type* s) const { - return compare(pos1, n1, s, traits_type::length(s)); + return compare(pos1, n1, s, traits_type::length(s)); } int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const { Enforce(pos1 <= size(), static_cast(0), ""); - Procust(n1, size() - pos1); - const int r = traits_type::compare(data(), s, Min(n1, n2)); - return - r != 0 ? r : - n1 > n2 ? 1 : - n1 < n2 ? -1 : - 0; + Procust(n1, size() - pos1); + const int r = traits_type::compare(data(), s, Min(n1, n2)); + return + r != 0 ? r : + n1 > n2 ? 1 : + n1 < n2 ? -1 : + 0; } int compare(size_type pos1, size_type n1, @@ -1092,9 +1092,9 @@ public: } int compare(const value_type* s) const - { - return traits_type::compare(data(), s, traits_type::length(s)); - } + { + return traits_type::compare(data(), s, traits_type::length(s)); + } }; // non-member functions @@ -1255,7 +1255,7 @@ std::basic_istream::value_type, typename flex_string::traits_type>& operator>>( std::basic_istream::value_type, - typename flex_string::traits_type>& is, + typename flex_string::traits_type>& is, flex_string& str); template @@ -1263,7 +1263,7 @@ std::basic_ostream::value_type, typename flex_string::traits_type>& operator<<( std::basic_ostream::value_type, - typename flex_string::traits_type>& os, + typename flex_string::traits_type>& os, const flex_string& str) { return os << str.c_str(); } diff --git a/include/loki/flex/simplestringstorage.h b/include/loki/flex/simplestringstorage.h index b9cfe44..c334336 100755 --- a/include/loki/flex/simplestringstorage.h +++ b/include/loki/flex/simplestringstorage.h @@ -219,14 +219,14 @@ public: template void append(InputIterator b, InputIterator e) { - const size_type - sz = std::distance(b, e), - neededCapacity = size() + sz; + const size_type + sz = std::distance(b, e), + neededCapacity = size() + sz; if (capacity() < neededCapacity) { - static std::less_equal le; - (void) le; - assert(!(le(begin(), &*b) && le(&*b, end()))); // no aliasing + static std::less_equal le; + (void) le; + assert(!(le(begin(), &*b) && le(&*b, end()))); // no aliasing reserve(neededCapacity); } std::copy(b, e, end()); @@ -274,7 +274,7 @@ SimpleStringStorage::emptyString_; //{ // const_cast(SimpleStringStorage::emptyString_.buffer_), // const_cast(SimpleStringStorage::emptyString_.buffer_), -// { E() } +// { E() } //}; diff --git a/include/loki/flex/smallstringopt.h b/include/loki/flex/smallstringopt.h index 86a0038..398bd06 100755 --- a/include/loki/flex/smallstringopt.h +++ b/include/loki/flex/smallstringopt.h @@ -97,7 +97,7 @@ private: public: enum { maxSmallString = - (temp2 + sizeof(value_type) - 1) / sizeof(value_type) }; + (temp2 + sizeof(value_type) - 1) / sizeof(value_type) }; private: enum { magic = maxSmallString + 1 }; @@ -260,14 +260,14 @@ public: else { // append to a small string - const size_type - sz = std::distance(b, e), - neededCapacity = maxSmallString - buf_[maxSmallString] + sz; + const size_type + sz = std::distance(b, e), + neededCapacity = maxSmallString - buf_[maxSmallString] + sz; if (maxSmallString < neededCapacity) { // need to change storage strategy - allocator_type alloc; + allocator_type alloc; Storage temp(alloc); temp.reserve(neededCapacity); temp.append(buf_, buf_ + maxSmallString - buf_[maxSmallString]); @@ -278,7 +278,7 @@ public: } else { - std::copy(b, e, buf_ + maxSmallString - buf_[maxSmallString]); + std::copy(b, e, buf_ + maxSmallString - buf_[maxSmallString]); buf_[maxSmallString] = buf_[maxSmallString] - value_type(sz); } } diff --git a/include/loki/flex/vectorstringstorage.h b/include/loki/flex/vectorstringstorage.h index b6955f1..ef52345 100755 --- a/include/loki/flex/vectorstringstorage.h +++ b/include/loki/flex/vectorstringstorage.h @@ -137,32 +137,32 @@ public: // protected: void reserve(size_type res_arg) { - assert(res_arg < max_size()); + assert(res_arg < max_size()); base::reserve(res_arg + 1); } template void append(ForwardIterator b, ForwardIterator e) { - const typename std::iterator_traits::difference_type - sz = std::distance(b, e); - assert(sz >= 0); - if (sz == 0) return; - base::reserve(base::size() + sz); - const value_type & v = *b; - struct OnBlockExit - { - VectorStringStorage * that; - ~OnBlockExit() - { - that->base::push_back(value_type()); - } - } onBlockExit = { this }; - (void) onBlockExit; - assert(!base::empty()); - assert(base::back() == value_type()); - base::back() = v; - base::insert(base::end(), ++b, e); + const typename std::iterator_traits::difference_type + sz = std::distance(b, e); + assert(sz >= 0); + if (sz == 0) return; + base::reserve(base::size() + sz); + const value_type & v = *b; + struct OnBlockExit + { + VectorStringStorage * that; + ~OnBlockExit() + { + that->base::push_back(value_type()); + } + } onBlockExit = { this }; + (void) onBlockExit; + assert(!base::empty()); + assert(base::back() == value_type()); + base::back() = v; + base::insert(base::end(), ++b, e); } void resize(size_type n, E c) diff --git a/include/loki/yasli/yasli_fill_iterator.h b/include/loki/yasli/yasli_fill_iterator.h index 37480b6..e1f148e 100755 --- a/include/loki/yasli/yasli_fill_iterator.h +++ b/include/loki/yasli/yasli_fill_iterator.h @@ -10,10 +10,10 @@ namespace yasli_nstd class fill_iterator_base : public std::iterator< std::random_access_iterator_tag, - T, - ptrdiff_t, - T*, - T&> + T, + ptrdiff_t, + T*, + T&> { }; @@ -21,112 +21,112 @@ namespace yasli_nstd class fill_iterator_base : public std::iterator< std::random_access_iterator_tag, - T, - ptrdiff_t, - T*, - T&> + T, + ptrdiff_t, + T*, + T&> { }; template class fill_iterator : public fill_iterator_base - { + { T value_; /*difference_type*/ ptrdiff_t count_;////////////////////////////////// public: typedef std::ptrdiff_t difference_type; typedef typename fill_iterator_base::pointer pointer; - typedef typename fill_iterator_base::reference reference; - //typedef iterator_type; + typedef typename fill_iterator_base::reference reference; + //typedef iterator_type; - fill_iterator() - { - } + fill_iterator() + { + } - explicit fill_iterator(reference value, difference_type count = 0) - : value_(value), count_(count) - { - } + explicit fill_iterator(reference value, difference_type count = 0) + : value_(value), count_(count) + { + } - template - fill_iterator(const fill_iterator& rhs) - : value_(rhs.value_), count_(rhs.count_) - { - } - - reference operator*() const - { - return value_; - } - - pointer operator->() const + template + fill_iterator(const fill_iterator& rhs) + : value_(rhs.value_), count_(rhs.count_) { - return &**this; - } + } - fill_iterator& operator++() - { + reference operator*() const + { + return value_; + } + + pointer operator->() const + { + return &**this; + } + + fill_iterator& operator++() + { ++count_; - return *this; - } + return *this; + } - fill_iterator operator++(int) + fill_iterator operator++(int) { - fill_iterator it(*this); + fill_iterator it(*this); ++*this; - return it; + return it; } - fill_iterator& operator--() - { + fill_iterator& operator--() + { --count_; - return *this; - } - - fill_iterator operator--(int) - { - fill_iterator it(*this); - --*this; - return it; + return *this; } - fill_iterator& operator+=(difference_type d) - { - count_ += d; - return *this; - } + fill_iterator operator--(int) + { + fill_iterator it(*this); + --*this; + return it; + } - fill_iterator operator+(difference_type d) const - { - return fill_iterator(*this) += d; - } + fill_iterator& operator+=(difference_type d) + { + count_ += d; + return *this; + } - fill_iterator& operator-=(difference_type d) - { - count_ -= d; - return *this; - } + fill_iterator operator+(difference_type d) const + { + return fill_iterator(*this) += d; + } - fill_iterator operator-(difference_type d) const - { - return fill_iterator(*this) -= d; - } + fill_iterator& operator-=(difference_type d) + { + count_ -= d; + return *this; + } + + fill_iterator operator-(difference_type d) const + { + return fill_iterator(*this) -= d; + } difference_type operator-(const fill_iterator& rhs) const { - return count_ - rhs.count_; + return count_ - rhs.count_; } - reference operator[](difference_type) const - { - return **this; - } + reference operator[](difference_type) const + { + return **this; + } template bool operator==(const fill_iterator& rhs) const - { - return count_ == rhs.count_; + { + return count_ == rhs.count_; } }; @@ -134,21 +134,21 @@ namespace yasli_nstd template inline fill_iterator operator+(D lhs, const fill_iterator& rhs) { - return rhs + lhs; - } + return rhs + lhs; + } template inline bool operator!=( const fill_iterator& lhs, - const fill_iterator& rhs) - { // test for fill_iterator inequality + const fill_iterator& rhs) + { // test for fill_iterator inequality return !(lhs == rhs); } template inline bool operator<( const fill_iterator& lhs, - const fill_iterator& rhs) + const fill_iterator& rhs) { return lhs.count_ < rhs.count_; } @@ -156,7 +156,7 @@ namespace yasli_nstd template inline bool operator>( const fill_iterator& lhs, - const fill_iterator& rhs) + const fill_iterator& rhs) { return rhs < lhs; } @@ -164,7 +164,7 @@ namespace yasli_nstd template inline bool operator<=( const fill_iterator& lhs, - const fill_iterator& rhs) + const fill_iterator& rhs) { return !(rhs < lhs); } diff --git a/include/loki/yasli/yasli_traits.h b/include/loki/yasli/yasli_traits.h index 9bdd860..c4d8715 100755 --- a/include/loki/yasli/yasli_traits.h +++ b/include/loki/yasli/yasli_traits.h @@ -60,7 +60,7 @@ namespace yasli_nstd enum { value = int(!is_class::value) }; }; - + template struct is_memmoveable { enum { value = int(!is_class::value) }; diff --git a/include/loki/yasli/yasli_vector.h b/include/loki/yasli/yasli_vector.h index 3f9da1c..96fa87b 100755 --- a/include/loki/yasli/yasli_vector.h +++ b/include/loki/yasli/yasli_vector.h @@ -316,13 +316,13 @@ namespace yasli { } const_reference at(size_type n) const { - // Fix by Joseph Canedo + // Fix by Joseph Canedo if (n >= size()) throw std::range_error("vector<>::at"); return ebo_.beg_[n]; } reference at(size_type n) { - // Fix by Joseph Canedo + // Fix by Joseph Canedo if (n >= size()) throw std::range_error("vector<>::at"); return ebo_.beg_[n]; } diff --git a/test/Pimpl/main.cpp b/test/Pimpl/main.cpp index 52ba9ea..4d98c1d 100755 --- a/test/Pimpl/main.cpp +++ b/test/Pimpl/main.cpp @@ -310,7 +310,7 @@ void test_more() delete p9; delete p10; - + Loki::Printf("\nCreating Rimpls\n"); R1* r1 = new R1; R2* r2 = new R2; diff --git a/test/Pimpl/type.h b/test/Pimpl/type.h index c74cef5..2a1a187 100755 --- a/test/Pimpl/type.h +++ b/test/Pimpl/type.h @@ -102,7 +102,7 @@ typedef std::auto_ptr > StdAutoPtr; // Pimpl -typedef Pimpl > Pimpl1; +typedef Pimpl > Pimpl1; typedef Pimpl, CPropPtr> Pimpl2; typedef Pimpl, LokiPtr> Pimpl3; typedef Pimpl, BoostPtr> Pimpl4; @@ -117,7 +117,7 @@ struct P5 {Pimpl5 d; P5();void f();void f()const;}; // PimplOwner -typedef PimplOwner > PimplOwner1; +typedef PimplOwner > PimplOwner1; typedef PimplOwner, CPropPtr> PimplOwner2; typedef PimplOwner, LokiPtr> PimplOwner3; typedef PimplOwner, BoostPtr> PimplOwner4; diff --git a/test/Pimpl/type2.h b/test/Pimpl/type2.h index 029a69e..7d1d661 100755 --- a/test/Pimpl/type2.h +++ b/test/Pimpl/type2.h @@ -26,7 +26,7 @@ class A2 { public: A2(); - ~A2(); + ~A2(); void foo(); private: @@ -42,7 +42,7 @@ class B2 : private PimplT::Owner { public: B2(); - ~B2(); + ~B2(); void foo(); }; @@ -56,7 +56,7 @@ class C2 { public: C2(); - ~C2(); + ~C2(); void foo(); private: @@ -73,7 +73,7 @@ class D2 : private RimplT::Owner { public: D2(); - ~D2(); + ~D2(); void foo(); }; @@ -94,7 +94,7 @@ class Incomplete2 { public: Incomplete2(); - ~Incomplete2(); + ~Incomplete2(); void foo(); private: PimplT::Type d; @@ -108,10 +108,10 @@ class Incomplete3 { public: Incomplete3(); - ~Incomplete3() - { - // inline destructor - } + ~Incomplete3() + { + // inline destructor + } void foo(); private: PimplT::Type d; diff --git a/test/Register/foo.cpp b/test/Register/foo.cpp index 25d8fa9..1721f86 100755 --- a/test/Register/foo.cpp +++ b/test/Register/foo.cpp @@ -37,24 +37,24 @@ Base* createBoo(){ return new Boo; } namespace Loki { template<> bool RegisterFunction() - { - std::cout << "RegisterFunction\n"; - return registerClass("Foo", &createFoo); - } + { + std::cout << "RegisterFunction\n"; + return registerClass("Foo", &createFoo); + } template<> bool RegisterFunction() - { - std::cout << "RegisterFunction\n"; - return registerClass("Boo", &createBoo); - } + { + std::cout << "RegisterFunction\n"; + return registerClass("Boo", &createBoo); + } template<> bool UnRegisterFunction() - { - std::cout << "UnRegisterFunction\n"; - return true; - } + { + std::cout << "UnRegisterFunction\n"; + return true; + } template<> bool UnRegisterFunction() - { - std::cout << "UnRegisterFunction\n"; - return true; - } + { + std::cout << "UnRegisterFunction\n"; + return true; + } } diff --git a/test/Register/main.cpp b/test/Register/main.cpp index 5baa16f..926c141 100755 --- a/test/Register/main.cpp +++ b/test/Register/main.cpp @@ -39,7 +39,7 @@ int main() { Base* foo = BaseFactory::Instance().CreateObject("Foo"); Base* boo = BaseFactory::Instance().CreateObject("Boo"); - + foo->foo(); boo->foo(); diff --git a/test/SingletonDll/foo_export.h b/test/SingletonDll/foo_export.h index 0f610cc..4393cac 100755 --- a/test/SingletonDll/foo_export.h +++ b/test/SingletonDll/foo_export.h @@ -15,8 +15,8 @@ #include #if (defined(FOO_MAKE_DLL) && defined(FOO_DLL)) || \ - (defined(FOO_MAKE_DLL) && defined(FOO_STATIC)) || \ - (defined(FOO_DLL) && defined(FOO_STATIC)) + (defined(FOO_MAKE_DLL) && defined(FOO_STATIC)) || \ + (defined(FOO_DLL) && defined(FOO_STATIC)) #error export macro error: you could not build AND use the library #endif diff --git a/test/SingletonDll/singletondll_export.h b/test/SingletonDll/singletondll_export.h index f0c8ef8..ccda406 100755 --- a/test/SingletonDll/singletondll_export.h +++ b/test/SingletonDll/singletondll_export.h @@ -15,8 +15,8 @@ #include #if (defined(SINGLETONDLL_MAKE_DLL) && defined(SINGLETONDLL_DLL)) || \ - (defined(SINGLETONDLL_MAKE_DLL) && defined(SINGLETONDLL_STATIC)) || \ - (defined(SINGLETONDLL_DLL) && defined(SINGLETONDLL_STATIC)) + (defined(SINGLETONDLL_MAKE_DLL) && defined(SINGLETONDLL_STATIC)) || \ + (defined(SINGLETONDLL_DLL) && defined(SINGLETONDLL_STATIC)) #error export macro error: you could not build AND use the library #endif