replace.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef BOOST_MPL_REPLACE_HPP_INCLUDED
  2. #define BOOST_MPL_REPLACE_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2000-2004
  4. // Copyright John R. Bandela 2000-2002
  5. // Copyright David Abrahams 2003-2004
  6. //
  7. // Distributed under the Boost Software License, Version 1.0.
  8. // (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. // See http://www.boost.org/libs/mpl for documentation.
  12. // $Id$
  13. // $Date$
  14. // $Revision$
  15. #include <boost/mpl/replace_if.hpp>
  16. #include <boost/mpl/same_as.hpp>
  17. #include <boost/mpl/aux_/inserter_algorithm.hpp>
  18. namespace boost { namespace mpl {
  19. namespace aux {
  20. template<
  21. typename Sequence
  22. , typename OldType
  23. , typename NewType
  24. , typename Inserter
  25. >
  26. struct replace_impl
  27. : replace_if_impl< Sequence, same_as<OldType>, NewType, Inserter >
  28. {
  29. };
  30. template<
  31. typename Sequence
  32. , typename OldType
  33. , typename NewType
  34. , typename Inserter
  35. >
  36. struct reverse_replace_impl
  37. : reverse_replace_if_impl< Sequence, same_as<OldType>, NewType, Inserter >
  38. {
  39. };
  40. } // namespace aux
  41. BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, replace)
  42. }}
  43. #endif // BOOST_MPL_REPLACE_HPP_INCLUDED