ove macro values into Loki namespace

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@769 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-10-26 10:58:19 +00:00
parent f643f9a5d8
commit 8f7c3b42d7
4 changed files with 11 additions and 4 deletions

View file

@ -53,7 +53,7 @@ namespace Loki
// default will not break existing code
#ifndef LOKI_DEFAULT_CONSTNESS
#define LOKI_DEFAULT_CONSTNESS DontPropagateConst
#define LOKI_DEFAULT_CONSTNESS ::Loki::DontPropagateConst
#endif
} // end namespace Loki

View file

@ -358,8 +358,8 @@ namespace Loki
#define LOKI_CONCATENATE(s1, s2) LOKI_CONCATENATE_DIRECT(s1, s2)
#define LOKI_ANONYMOUS_VARIABLE(str) LOKI_CONCATENATE(str, __LINE__)
#define LOKI_ON_BLOCK_EXIT ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
#define LOKI_ON_BLOCK_EXIT_OBJ ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
#define LOKI_ON_BLOCK_EXIT ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = ::Loki::MakeGuard
#define LOKI_ON_BLOCK_EXIT_OBJ ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = ::Loki::MakeObjGuard
#endif // end file guardian

View file

@ -37,7 +37,7 @@
#endif
#ifndef LOKI_DEFAULT_SMALLOBJ_LIFETIME
#define LOKI_DEFAULT_SMALLOBJ_LIFETIME LongevityLifetime::DieAsSmallObjectParent
#define LOKI_DEFAULT_SMALLOBJ_LIFETIME ::Loki::LongevityLifetime::DieAsSmallObjectParent
#endif
#if defined(LOKI_SMALL_OBJECT_USE_NEW_ARRAY) && defined(_MSC_VER)

View file

@ -43,6 +43,7 @@ public:
void AddFriend(User& newFriend);
void AddFriendGuarded(User& newFriend);
void AddFriendGuardedMacros(User& newFriend);
size_t countFriends();
@ -84,6 +85,12 @@ void User::AddFriendGuarded(User& newFriend)
guardRef.Dismiss();
}
void User::AddFriendGuardedMacros(User&)
{
LOKI_ON_BLOCK_EXIT_OBJ(friends_, &UserCont::pop_back); (void) LOKI_ANONYMOUS_VARIABLE(scopeGuard);
LOKI_ON_BLOCK_EXIT(Decrement, Loki::ByRef(fCount)); (void) LOKI_ANONYMOUS_VARIABLE(scopeGuard);
}
int main()
{