1 | #ifndef _theplu_yat_normalizer_utility_ |
---|
2 | #define _theplu_yat_normalizer_utility_ |
---|
3 | |
---|
4 | // $Id: utility.h 2155 2010-01-17 23:22:10Z peter $ |
---|
5 | |
---|
6 | /* |
---|
7 | Copyright (C) 2010 Peter Johansson |
---|
8 | |
---|
9 | This file is part of the yat library, http://dev.thep.lu.se/yat |
---|
10 | |
---|
11 | The yat library is free software; you can redistribute it and/or |
---|
12 | modify it under the terms of the GNU General Public License as |
---|
13 | published by the Free Software Foundation; either version 3 of the |
---|
14 | License, or (at your option) any later version. |
---|
15 | |
---|
16 | The yat library is distributed in the hope that it will be useful, |
---|
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | General Public License for more details. |
---|
20 | |
---|
21 | You should have received a copy of the GNU General Public License |
---|
22 | along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|
23 | */ |
---|
24 | |
---|
25 | #include "yat/utility/iterator_traits.h" |
---|
26 | #include "yat/utility/WeightIterator.h" |
---|
27 | |
---|
28 | #include <algorithm> |
---|
29 | |
---|
30 | namespace theplu { |
---|
31 | namespace yat { |
---|
32 | namespace normalizer { |
---|
33 | |
---|
34 | // internal functions in namespace detail |
---|
35 | namespace detail { |
---|
36 | template<typename InputIterator, typename OutputIterator> |
---|
37 | void copy_weight_if_weighted(InputIterator first, InputIterator last, |
---|
38 | OutputIterator result, |
---|
39 | utility::unweighted_iterator_tag tag) |
---|
40 | { |
---|
41 | } |
---|
42 | |
---|
43 | template<typename InputIterator, typename OutputIterator> |
---|
44 | void copy_weight_if_weighted(InputIterator first, InputIterator last, |
---|
45 | OutputIterator result, |
---|
46 | utility::weighted_iterator_tag tag) |
---|
47 | { |
---|
48 | using utility::weight_iterator; |
---|
49 | std::copy(weight_iterator(first), weight_iterator(last), |
---|
50 | weight_iterator(result)); |
---|
51 | } |
---|
52 | |
---|
53 | /** |
---|
54 | internal function |
---|
55 | |
---|
56 | if \a result is weighted copy weights from [first, last) else do nothing |
---|
57 | */ |
---|
58 | template<typename InputIterator, typename OutputIterator> |
---|
59 | void copy_weight_if_weighted(InputIterator first, InputIterator last, |
---|
60 | OutputIterator result) |
---|
61 | { |
---|
62 | typename utility::weighted_iterator_traits<OutputIterator>::type tag; |
---|
63 | copy_weight_if_weighted(first, last, result, tag); |
---|
64 | } |
---|
65 | } // of namespace detail |
---|
66 | |
---|
67 | }}} // of namespace normalizer, yat, and theplu |
---|
68 | |
---|
69 | #endif |
---|