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:
parent
f643f9a5d8
commit
8f7c3b42d7
4 changed files with 11 additions and 4 deletions
|
@ -53,7 +53,7 @@ namespace Loki
|
||||||
|
|
||||||
// default will not break existing code
|
// default will not break existing code
|
||||||
#ifndef LOKI_DEFAULT_CONSTNESS
|
#ifndef LOKI_DEFAULT_CONSTNESS
|
||||||
#define LOKI_DEFAULT_CONSTNESS DontPropagateConst
|
#define LOKI_DEFAULT_CONSTNESS ::Loki::DontPropagateConst
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // end namespace Loki
|
} // end namespace Loki
|
||||||
|
|
|
@ -358,8 +358,8 @@ namespace Loki
|
||||||
#define LOKI_CONCATENATE(s1, s2) LOKI_CONCATENATE_DIRECT(s1, s2)
|
#define LOKI_CONCATENATE(s1, s2) LOKI_CONCATENATE_DIRECT(s1, s2)
|
||||||
#define LOKI_ANONYMOUS_VARIABLE(str) LOKI_CONCATENATE(str, __LINE__)
|
#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 ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = ::Loki::MakeGuard
|
||||||
#define LOKI_ON_BLOCK_EXIT_OBJ ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
|
#define LOKI_ON_BLOCK_EXIT_OBJ ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) = ::Loki::MakeObjGuard
|
||||||
|
|
||||||
#endif // end file guardian
|
#endif // end file guardian
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LOKI_DEFAULT_SMALLOBJ_LIFETIME
|
#ifndef LOKI_DEFAULT_SMALLOBJ_LIFETIME
|
||||||
#define LOKI_DEFAULT_SMALLOBJ_LIFETIME LongevityLifetime::DieAsSmallObjectParent
|
#define LOKI_DEFAULT_SMALLOBJ_LIFETIME ::Loki::LongevityLifetime::DieAsSmallObjectParent
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LOKI_SMALL_OBJECT_USE_NEW_ARRAY) && defined(_MSC_VER)
|
#if defined(LOKI_SMALL_OBJECT_USE_NEW_ARRAY) && defined(_MSC_VER)
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
|
|
||||||
void AddFriend(User& newFriend);
|
void AddFriend(User& newFriend);
|
||||||
void AddFriendGuarded(User& newFriend);
|
void AddFriendGuarded(User& newFriend);
|
||||||
|
void AddFriendGuardedMacros(User& newFriend);
|
||||||
|
|
||||||
size_t countFriends();
|
size_t countFriends();
|
||||||
|
|
||||||
|
@ -84,6 +85,12 @@ void User::AddFriendGuarded(User& newFriend)
|
||||||
guardRef.Dismiss();
|
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()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue