1 | |

2 | __#ifndef BOOST_MPL_REPLACE_IF_HPP_INCLUDED__ |

3 | __#define BOOST_MPL_REPLACE_IF_HPP_INCLUDED__ |

4 | |

5 | *// Copyright Aleksey Gurtovoy 2000-2004* |

6 | *// Copyright John R. Bandela 2000-2002* |

7 | *// Copyright David Abrahams 2003-2004* |

8 | *//* |

9 | *// Distributed under the Boost Software License, Version 1.0. * |

10 | *// (See accompanying file LICENSE_1_0.txt or copy at * |

11 | *// http://www.boost.org/LICENSE_1_0.txt)* |

12 | *//* |

13 | *// See http://www.boost.org/libs/mpl for documentation.* |

14 | |

15 | *// $Id$* |

16 | *// $Date$* |

17 | *// $Revision$* |

18 | |

19 | __#include <boost/mpl/transform.hpp>__ |

20 | __#include <boost/mpl/apply.hpp>__ |

21 | __#include <boost/mpl/if.hpp>__ |

22 | __#include <boost/mpl/aux_/inserter_algorithm.hpp>__ |

23 | __#include <boost/mpl/aux_/config/forwarding.hpp>__ |

24 | |

25 | **namespace** boost { **namespace** mpl { |

26 | |

27 | **namespace** aux { |

28 | |

29 | **template**< **typename** Predicate, **typename** T > |

30 | **struct** replace_if_op |

31 | { |

32 | **template**< **typename** U > **struct** apply |

33 | __#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)__ |

34 | : if_< |

35 | **typename** apply1<Predicate,U>::type |

36 | , T |

37 | , U |

38 | > |

39 | { |

40 | __#else__ |

41 | { |

42 | **typedef** **typename** if_< |

43 | **typename** apply1<Predicate,U>::type |

44 | , T |

45 | , U |

46 | >::type type; |

47 | __#endif__ |

48 | }; |

49 | }; |

50 | |

51 | |

52 | **template**< |

53 | **typename** Sequence |

54 | , **typename** Predicate |

55 | , **typename** T |

56 | , **typename** Inserter |

57 | > |

58 | **struct** replace_if_impl |

59 | : transform1_impl< |

60 | Sequence |

61 | , protect< aux::replace_if_op<Predicate,T> > |

62 | , Inserter |

63 | > |

64 | { |

65 | }; |

66 | |

67 | **template**< |

68 | **typename** Sequence |

69 | , **typename** Predicate |

70 | , **typename** T |

71 | , **typename** Inserter |

72 | > |

73 | **struct** reverse_replace_if_impl |

74 | : reverse_transform1_impl< |

75 | Sequence |

76 | , protect< aux::replace_if_op<Predicate,T> > |

77 | , Inserter |

78 | > |

79 | { |

80 | }; |

81 | |

82 | } *// namespace aux* |

83 | |

84 | BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(`4`, replace_if) |

85 | |

86 | }} |

87 | |

88 | __#endif // BOOST_MPL_REPLACE_IF_HPP_INCLUDED__ |

89 | |