/* Example programs from the book Scientific and Engineering Programming in C++: An Introduction with Advanced Techniques and Examples, Addison-Wesley, 1994. (c) COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 1994. ALL RIGHTS RESERVED. See README file for further details. */ #ifndef EquivalentToCategoryH #define EquivalentToCategoryH #include "SciEng/Boolean.h" template class EquivalentToCategory { // This class needed for type restriction }; template inline Boolean operator==(const EquivalentToCategory& lhs, const T2& rhs) { return ((const T1&) lhs).equivalentTo((const T2&) rhs); } template inline Boolean operator==(const T2& lhs, const EquivalentToCategory& rhs) { return rhs == lhs; } template inline Boolean operator!=(const EquivalentToCategory& lhs, const T2& rhs) { return ! ( lhs == rhs ); } template inline Boolean operator!=(const T2& lhs, const EquivalentToCategory& rhs) { return rhs != lhs; } #endif