PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/Src/Dependencies/Boost/boost/fusion/algorithm/transformation/replace.hpp

http://hadesmem.googlecode.com/
C++ Header | 35 lines | 24 code | 5 blank | 6 comment | 0 complexity | d0b0b75a12025e16694cd8a2b2e01229 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2006 Joel de Guzman
 3
 4    Distributed under the Boost Software License, Version 1.0. (See accompanying 
 5    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 6==============================================================================*/
 7#if !defined(FUSION_REPLACE_08182005_0830)
 8#define FUSION_REPLACE_08182005_0830
 9
10#include <boost/fusion/view/transform_view/transform_view.hpp>
11#include <boost/fusion/algorithm/transformation/detail/replace.hpp>
12
13namespace boost { namespace fusion
14{
15    namespace result_of
16    {
17        template <typename Sequence, typename T>
18        struct replace
19        {
20            typedef transform_view<Sequence, detail::replacer<T> > type;
21        };
22    }
23
24    template <typename Sequence, typename T>
25    inline typename result_of::replace<Sequence const, T>::type
26    replace(Sequence const& seq, T const& old_value, T const& new_value)
27    {
28        typedef typename result_of::replace<Sequence const, T>::type result;
29        detail::replacer<T> f(old_value, new_value);
30        return result(seq, f);
31    }
32}}
33
34#endif
35