2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief auto_unit_test internal header */
17 #ifndef IH_SENF_senf_Utils_auto_unit_test_
18 #define IH_SENF_senf_Utils_auto_unit_test_ 1
22 #include <boost/iterator/iterator_adaptor.hpp>
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
30 template <class Type, class Iterator>
31 struct ConvertingIterator
32 : public boost::iterator_adaptor<
33 ConvertingIterator<Type, Iterator>, Iterator, Type, boost::use_default, Type>
35 typedef boost::iterator_adaptor<
36 ConvertingIterator<Type, Iterator>, Iterator, Type, boost::use_default, Type> Base;
37 ConvertingIterator(Iterator i) : Base (i) {}
40 template <class Iterator, class vt = typename std::iterator_traits<Iterator>::value_type>
42 { typedef Iterator type; };
44 template <class Iterator>
45 struct NoCharIterator<Iterator, char>
46 { typedef ConvertingIterator<int,Iterator> type; };
48 template <class Iterator>
49 struct NoCharIterator<Iterator, signed char>
50 { typedef ConvertingIterator<int,Iterator> type; };
52 template <class Iterator>
53 struct NoCharIterator<Iterator, unsigned char>
54 { typedef ConvertingIterator<unsigned,Iterator> type; };
58 //-/////////////////////////////////////////////////////////////////////////////////////////////////
66 // c-file-style: "senf"
67 // indent-tabs-mode: nil
68 // ispell-local-dictionary: "american"
69 // compile-command: "scons -u test"