Signal/Geometry Processing Library (SPL)  1.1.24
misc.hpp
Go to the documentation of this file.
1 // Copyright (c) 2011 Michael D. Adams
2 // All rights reserved.
3 
4 // __START_OF_LICENSE__
5 //
6 // Copyright (c) 2015 Michael D. Adams
7 // All rights reserved.
8 //
9 // This file is part of the Signal Processing Library (SPL).
10 //
11 // This program 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,
14 // or (at your option) any later version.
15 //
16 // This program 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
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public
22 // License along with this program; see the file LICENSE. If not,
23 // see <http://www.gnu.org/licenses/>.
24 //
25 // __END_OF_LICENSE__
26 
32 #ifndef SPL_misc_hpp
33 #define SPL_misc_hpp
34 
36 // Header Files.
38 
39 #include <SPL/config.hpp>
40 
42 //
44 
45 namespace SPL {
46 
48 //
50 
55 template< class InputIterator, class Size, class OutputIterator>
56 OutputIterator copy_n(InputIterator first, Size count, OutputIterator result)
57 {
58  if (count > 0) {
59  *result++ = *first;
60  for (Size i = 1; i < count; ++i) {
61  *result++ = *++first;
62  }
63  }
64  return result;
65 }
66 
68 //
70 
71 }
72 
73 #endif
Definition: Arcball.hpp:48