aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
list.cpp
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /**
23  * @file
24  * @brief outlined implementations for the chained lists
25  *
26  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
27  */
28 
29 #include <agrum/tools/core/list.h>
30 
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 
33 namespace gum {
34 
35 # define GCC_STR(s) # s
36 # define GCC_JOINSTR(x, y) GCC_STR(x##y)
37 
38 # if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405
39 # define GCC_DIAG_DO_PRAGMA(x) Pragma_(# x)
40 # define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
41 # if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
42 # define GCC_DIAG_OFF(x)
43  GCC_DIAG_PRAGMA(push) GCC_DIAG_PRAGMA(ignored GCC_JOINSTR(-W, x))
44 # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
45 # else
46 # define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_JOINSTR(-W, x))
47 # define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_JOINSTR(-W, x))
48 # endif
49 # else
50 # define GCC_DIAG_OFF(x)
51 # define GCC_DIAG_ON(x)
52 # endif
53 
54  // Destructor for end/rend
55  template <>
57 
58  // constructor for end/rend
59  template <>
61 
62  // Destructor for end/rend
63  template <>
64  ListConstIterator< Debug >::~ListConstIterator() noexcept {}
65 
66  // constructor for end/rend
67  template <>
68  ListConstIterator< Debug >::ListConstIterator() noexcept {}
69 
70  // an iterator that represents both end and rend for all the Lists
71  // (whatever their type). This is mainly what stroustrup suggests
72  // in his C++ programming language, third edition, page 854
74  static const ListConstIterator< Debug > static_list_end__;
75 
76  static constexpr const void* get_list_end_safe__() {
77  return &static_list_end_safe__;
78  }
79  static constexpr const void* get_list_end__() { return &static_list_end__; }
80 
81  const void* const list_end_safe__ = get_list_end_safe__();
82  const void* const list_end__ = get_list_end__();
83 
84 } /* namespace gum */
85 
86 
87 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
88 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
89 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
90 template class gum::List< bool >;
91 # endif
92 # endif
93 # endif
94 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
95 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
96 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
97 template class gum::List< int >;
98 # endif
99 # endif
100 # endif
101 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
102 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
103 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
104 template class gum::List< unsigned int >;
105 # endif
106 # endif
107 # endif
108 
109 
110 #endif // DOXYGEN_SHOULD_SKIP_THIS
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669