Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_NullIteratorTraits.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_NULL_ITERATOR_TRAITS_HPP
11 #define TEUCHOS_NULL_ITERATOR_TRAITS_HPP
12 
13 
14 #include "Teuchos_ConfigDefs.hpp"
15 
16 
17 namespace Teuchos {
18 
19 
20 
29 template<typename Iter>
31 public:
32  static Iter getNull()
33  {
34 #ifdef TEUCHOS_NO_ZERO_ITERATOR_CONVERSION
35  return Iter();
36 #else
37  return Iter(0);
38 #endif
39  }
40 };
41 
42 
47 template<typename Iter>
48 class NullIteratorTraits<std::reverse_iterator<Iter> > {
49 public:
50  static std::reverse_iterator<Iter> getNull()
51  {
52  return std::reverse_iterator<Iter>(
54  );
55  }
56 };
57 
58 
59 } // namespace Teuchos
60 
61 
62 #endif // TEUCHOS_NULL_ITERATOR_TRAITS_HPP
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
Base traits class for getting a properly initialized null pointer.