Go to the documentation of this file.
49 #include <initializer_list>
58 #if (__cplusplus >= 201402L)
59 # define FOAM_DEPRECATED(since) [[deprecated("Since " #since)]]
60 # define FOAM_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]]
61 #elif defined(__GNUC__)
62 # define FOAM_DEPRECATED(since) __attribute__((__deprecated__("Since " #since)))
63 # define FOAM_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement)))
65 # define FOAM_DEPRECATED(since)
66 # define FOAM_DEPRECATED_FOR(since, replacement)
83 using std::unique_ptr;
97 constexpr
auto begin(
C&
c) -> decltype(
c.begin())
105 constexpr
auto begin(
const C&
c) -> decltype(
c.begin())
113 constexpr
auto cbegin(
const C&
c) -> decltype(
c.begin())
121 constexpr
auto end(
C&
c) -> decltype(
c.end())
129 constexpr
auto end(
const C&
c) -> decltype(
c.end())
137 constexpr
auto cend(
const C&
c) -> decltype(
c.end())
156 constexpr
auto rbegin(
const C&
c) -> decltype(
c.rbegin())
172 constexpr
auto rend(
C&
c) -> decltype(
c.rend())
180 constexpr
auto rend(
const C&
c) -> decltype(
c.rend())
188 constexpr
auto crend(
const C&
c) -> decltype(
c.rend())
196 constexpr
inline const T&
min(
const T& a,
const T&
b)
198 return (
b < a) ?
b : a;
204 constexpr
inline const T&
max(
const T& a,
const T&
b)
206 return (a <
b) ?
b : a;
223 #define forAllIters(container,iter) \
226 auto iter = stdFoam::begin(container); \
227 iter != stdFoam::end(container); \
241 #define forAllConstIters(container,iter) \
244 auto iter = stdFoam::cbegin(container); \
245 iter != stdFoam::cend(container); \
260 #define forAllReverseIters(container,iter) \
263 auto iter = stdFoam::rbegin(container); \
264 iter != stdFoam::rend(container); \
278 #define forAllConstReverseIters(container,iter) \
281 auto iter = stdFoam::crbegin(container); \
282 iter != stdFoam::crend(container); \
296 #define forAll(list, i) \
297 for (Foam::label i=0; i<(list).size(); ++i)
309 #define forAllReverse(list, i) \
310 for (Foam::label i=(list).size()-1; i>=0; --i)
325 #define forAllIter(Container,container,iter) \
328 Container::iterator iter = (container).begin(); \
329 iter != (container).end(); \
344 #define forAllConstIter(Container,container,iter) \
347 Container::const_iterator iter = (container).cbegin(); \
348 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.
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.