From 82dc6426b4cbf769ace7976c2a40d160b8d76f08 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 11 Aug 2011 18:12:14 +0200 Subject: Move func 'REF' from util.h to serialize.h util.h doesn't use REF, serialize.h does, creating a dependency of serialize.h on util.h, but util.h already depends on serialize.h. To resolve this circular dependency the function 'REF' has now been moved closer to one of its two points of use. Signed-off-by: Giel van Schijndel --- src/serialize.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/serialize.h') diff --git a/src/serialize.h b/src/serialize.h index c55775242b..0a31ff557d 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -63,10 +63,13 @@ static const int VERSION = 32500; static const char* pszSubVer = ""; static const bool VERSION_IS_BETA = true; - - - - +// Used to bypass the rule against non-const reference to temporary +// where it makes sense with wrappers such as CFlatData or CTxDB +template +inline T& REF(const T& val) +{ + return const_cast(val); +} ///////////////////////////////////////////////////////////////// // -- cgit v1.2.3