ReactOS  0.4.15-dev-2956-g61e7ea5
null_output_iterator.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 KJK::Hyperion
3 
4  Permission is hereby granted, free of charge, to any person obtaining a
5  copy of this software and associated documentation files (the "Software"),
6  to deal in the Software without restriction, including without limitation
7  the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the
9  Software is furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in
12  all copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  DEALINGS IN THE SOFTWARE.
21 */
22 
23 #ifndef KJK_NULL_OUTPUT_ITERATOR_H_
24 #define KJK_NULL_OUTPUT_ITERATOR_H_
25 
26 #include <cstddef>
27 #include <iterator>
28 
29 namespace kjk
30 {
31  template<class Type>
33  {
34  const Type& operator=(const Type& x) { return x; }
35  };
36 
37  template<class Type, class Distance = std::ptrdiff_t, class Pointer = Type *>
38  struct null_output_iterator: public std::iterator<std::output_iterator_tag, Type, Distance, Pointer, null_output_reference<Type> >
39  {
42  const null_output_iterator& operator=(const null_output_iterator&) { return *this; }
43  const null_output_iterator& operator++() { return *this; }
46  };
47 }
48 
49 #endif
50 
51 // EOF
const Type & operator=(const Type &x)
const null_output_iterator & operator=(const null_output_iterator &)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
null_output_iterator(const null_output_iterator &)
Type
Definition: Type.h:6
null_output_reference< Type > operator *()
WDF_CHILD_LIST_ITERATOR iterator
const null_output_iterator & operator++()
null_output_iterator operator++(int)