yat
0.8.3pre
|
00001 #ifndef _theplu_yat_normalizer_utility_ 00002 #define _theplu_yat_normalizer_utility_ 00003 00004 // $Id: utility.h 2155 2010-01-17 23:22:10Z peter $ 00005 00006 /* 00007 Copyright (C) 2010 Peter Johansson 00008 00009 This file is part of the yat library, http://dev.thep.lu.se/yat 00010 00011 The yat library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License as 00013 published by the Free Software Foundation; either version 3 of the 00014 License, or (at your option) any later version. 00015 00016 The yat library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with yat. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #include "yat/utility/iterator_traits.h" 00026 #include "yat/utility/WeightIterator.h" 00027 00028 #include <algorithm> 00029 00030 namespace theplu { 00031 namespace yat { 00032 namespace normalizer { 00033 00034 // internal functions in namespace detail 00035 namespace detail { 00036 template<typename InputIterator, typename OutputIterator> 00037 void copy_weight_if_weighted(InputIterator first, InputIterator last, 00038 OutputIterator result, 00039 utility::unweighted_iterator_tag tag) 00040 { 00041 } 00042 00043 template<typename InputIterator, typename OutputIterator> 00044 void copy_weight_if_weighted(InputIterator first, InputIterator last, 00045 OutputIterator result, 00046 utility::weighted_iterator_tag tag) 00047 { 00048 using utility::weight_iterator; 00049 std::copy(weight_iterator(first), weight_iterator(last), 00050 weight_iterator(result)); 00051 } 00052 00058 template<typename InputIterator, typename OutputIterator> 00059 void copy_weight_if_weighted(InputIterator first, InputIterator last, 00060 OutputIterator result) 00061 { 00062 typename utility::weighted_iterator_traits<OutputIterator>::type tag; 00063 copy_weight_if_weighted(first, last, result, tag); 00064 } 00065 } // of namespace detail 00066 00067 }}} // of namespace normalizer, yat, and theplu 00068 00069 #endif