Go to the documentation of this file.
49 #include <initializer_list>
57 #if defined(__cplusplus) && (__cplusplus >= 201402L)
58 # define FOAM_DEPRECATED(since) [[deprecated("Since " #since)]]
59 # define FOAM_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]]
60 #elif defined(__GNUC__)
61 # define FOAM_DEPRECATED(since) __attribute__((__deprecated__("Since " #since)))
62 # define FOAM_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement)))
64 # define FOAM_DEPRECATED(since)
65 # define FOAM_DEPRECATED_FOR(since, replacement)
91 constexpr
auto begin(
C&
c) -> decltype(
c.begin())
99 constexpr
auto begin(
const C&
c) -> decltype(
c.begin())
107 constexpr
auto cbegin(
const C&
c) -> decltype(
c.begin())
115 constexpr
auto end(
C&
c) -> decltype(
c.end())
123 constexpr
auto end(
const C&
c) -> decltype(
c.end())
131 constexpr
auto cend(
const C&
c) -> decltype(
c.end())
150 constexpr
auto rbegin(
const C&
c) -> decltype(
c.rbegin())
166 constexpr
auto rend(
C&
c) -> decltype(
c.rend())
174 constexpr
auto rend(
const C&
c) -> decltype(
c.rend())
182 constexpr
auto crend(
const C&
c) -> decltype(
c.rend())
190 constexpr
inline const T&
min(
const T& a,
const T&
b)
192 return (
b < a) ?
b : a;
198 constexpr
inline const T&
max(
const T& a,
const T&
b)
200 return (a <
b) ?
b : a;
217 #define forAllIters(container,iter) \
220 auto iter = stdFoam::begin(container); \
221 iter != stdFoam::end(container); \
235 #define forAllConstIters(container,iter) \
238 auto iter = stdFoam::cbegin(container); \
239 iter != stdFoam::cend(container); \
254 #define forAllReverseIters(container,iter) \
257 auto iter = stdFoam::rbegin(container); \
258 iter != stdFoam::rend(container); \
272 #define forAllConstReverseIters(container,iter) \
275 auto iter = stdFoam::crbegin(container); \
276 iter != stdFoam::crend(container); \
290 #define forAll(list, i) \
291 for (Foam::label i=0; i<(list).size(); ++i)
303 #define forAllReverse(list, i) \
304 for (Foam::label i=(list).size()-1; i>=0; --i)
319 #define forAllIter(Container,container,iter) \
322 Container::iterator iter = (container).begin(); \
323 iter != (container).end(); \
338 #define forAllConstIter(Container,container,iter) \
341 Container::const_iterator iter = (container).cbegin(); \
342 iter != (container).cend(); \
#define forAllConstReverseIters(container, iter)
Reverse iterate across elements of container object with const access.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object.
Global macros and templates used by OpenFOAM and some standard C++ headers.
constexpr auto crend(const C &c) -> decltype(c.rend())
Return const_reverse_iterator to reverse-end of container c.
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
constexpr auto begin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
#define forAll(list, i)
Loop across all elements in list.
constexpr auto crbegin(const C &c) -> decltype(c.rbegin())
Return const_reverse_iterator to the reverse-begin of container c.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
constexpr auto end(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
constexpr const T & max(const T &a, const T &b)
Return the greater of the parameters.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
constexpr auto rbegin(C &c) -> decltype(c.rbegin())
Return reverse_iterator to the reverse-begin of container c.
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
constexpr const T & min(const T &a, const T &b)
Return the lesser of the parameters.
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
#define forAllReverseIters(container, iter)
Reverse iterate across elements in the container object of type.
const dimensionedScalar c
Speed of light in a vacuum.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
constexpr auto rend(C &c) -> decltype(c.rend())
Return reverse_iterator to reverse-end of container c.