index_of.hpp 899 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef BOOST_MPL_INDEX_OF_HPP_INCLUDED
  2. #define BOOST_MPL_INDEX_OF_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2003-2004
  4. // Copyright Eric Friedman 2003
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/index_if.hpp>
  15. #include <boost/mpl/same_as.hpp>
  16. #include <boost/mpl/aux_/na_spec.hpp>
  17. #include <boost/mpl/aux_/lambda_support.hpp>
  18. namespace boost { namespace mpl {
  19. template<
  20. typename BOOST_MPL_AUX_NA_PARAM(Sequence)
  21. , typename BOOST_MPL_AUX_NA_PARAM(T)
  22. >
  23. struct index_of
  24. : index_if< Sequence,same_as<T> >
  25. {
  26. BOOST_MPL_AUX_LAMBDA_SUPPORT(2,index_of,(Sequence,T))
  27. };
  28. BOOST_MPL_AUX_NA_SPEC(2, index_of)
  29. }}
  30. #endif // BOOST_MPL_INDEX_OF_HPP_INCLUDED