// Semantics Consulting's Tyr Library // http://www.semantics.org // // Copyright (c) 2003 by Stephen C. Dewhurst // // Permission to use, copy, modify, distribute, and sell this software // for any purpose is hereby granted without fee, provided that the above // copyright notice appears in all copies and that both that copyright // notice and this permission notice appear in supporting documentation. // The author makes no representations about the suitability of this // software for any purpose. It is provided "as is" without express // or implied warranty. // Described in Unfinished Business. C/C++ Users Journal Experts Forum, 21, 11 (November 2003). #ifndef TYPELISTALGORITHMS_H #define TYPELISTALGORITHMS_H // Define this only if you have a very standard-compliant compiler. #define CORRECT_COMPILER #include "utils.h" #include "typelist.h" #include "metafunction.h" namespace Tyr { // These find algorithms return an index to the element found // // Find If template class Pred> struct FindIf; template class Pred> struct FindIf,Pred> { enum { r = Pred::r ? 0 : 1 + FindIf::r }; }; template