/* * Main authors: * Christian Schulte * * Copyright: * Christian Schulte, 2003 * * Last modified: * $Date: 2005-07-29 12:40:03 +0200 (Fri, 29 Jul 2005) $ by $Author: schulte $ * $Revision: 2076 $ * * This file is part of Gecode, the generic constraint * development environment: * http://www.gecode.org * * See the file "LICENSE" for information on usage and * redistribution of this file, and for a * DISCLAIMER OF ALL WARRANTIES. * */ namespace Gecode { namespace Int { namespace Distinct { template forceinline CombPtrFlag::CombPtrFlag(T* p1, T* p2) : cpf(reinterpret_cast(p1) ^ reinterpret_cast(p2)) {} template forceinline T* CombPtrFlag::ptr(T* p) const { return reinterpret_cast((cpf&~1) ^ reinterpret_cast(p)); } template forceinline int CombPtrFlag::is_set(void) const { return static_cast(cpf&1); } template forceinline void CombPtrFlag::set(void) { cpf |= 1; } template forceinline void CombPtrFlag::unset(void) { cpf &= ~1; } template forceinline void CombPtrFlag::init(T* p1, T* p2) { cpf = reinterpret_cast(p1) ^ reinterpret_cast(p2); } }}} // STATISTICS: int-prop