32 #ifndef Foam_stdFoam_H 33 #define Foam_stdFoam_H 36 #include <initializer_list> 45 #if (__cplusplus >= 201402L) 46 # define FOAM_DEPRECATED(since) [[deprecated("Since " #since)]] 47 # define FOAM_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] 48 #elif defined(__GNUC__) 49 # define FOAM_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) 50 # define FOAM_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) 52 # define FOAM_DEPRECATED(since) 53 # define FOAM_DEPRECATED_FOR(since, replacement) 59 # define FOAM_NODISCARD __attribute__((warn_unused_result)) 61 # define FOAM_NODISCARD 80 using std::unique_ptr;
92 return std::forward<T>(val);
111 template<
class T,
size_t N>
114 for (
size_t i = 0; i <
N; ++i)
144 constexpr
auto begin(
C&
c) -> decltype(
c.begin())
152 constexpr
auto begin(
const C&
c) -> decltype(
c.begin())
160 constexpr
auto cbegin(
const C&
c) -> decltype(
c.begin())
168 constexpr
auto end(
C&
c) -> decltype(
c.end())
176 constexpr
auto end(
const C&
c) -> decltype(
c.end())
184 constexpr
auto cend(
const C&
c) -> decltype(
c.end())
195 constexpr
auto rbegin(
C&
c) -> decltype(
c.rbegin())
203 constexpr
auto rbegin(
const C&
c) -> decltype(
c.rbegin())
211 constexpr
auto crbegin(
const C&
c) -> decltype(
c.rbegin())
219 constexpr
auto rend(
C&
c) -> decltype(
c.rend())
227 constexpr
auto rend(
const C&
c) -> decltype(
c.rend())
235 constexpr
auto crend(
const C&
c) -> decltype(
c.rend())
243 constexpr
inline const T&
min(
const T& a,
const T&
b)
245 return (
b < a) ?
b : a;
251 constexpr
inline const T&
max(
const T& a,
const T&
b)
253 return (a <
b) ?
b : a;
270 #define forAllIters(container,iter) \ 273 auto iter = stdFoam::begin(container); \ 274 iter != stdFoam::end(container); \ 288 #define forAllConstIters(container,iter) \ 291 auto iter = stdFoam::cbegin(container); \ 292 iter != stdFoam::cend(container); \ 307 #define forAllReverseIters(container,iter) \ 310 auto iter = stdFoam::rbegin(container); \ 311 iter != stdFoam::rend(container); \ 325 #define forAllConstReverseIters(container,iter) \ 328 auto iter = stdFoam::crbegin(container); \ 329 iter != stdFoam::crend(container); \ 343 #define forAll(list, i) \ 344 for (Foam::label i=0; i<(list).size(); ++i) 356 #define forAllReverse(list, i) \ 357 for (Foam::label i=(list).size()-1; i>=0; --i) 372 #define forAllIter(Container,container,iter) \ 375 Container::iterator iter = (container).begin(); \ 376 iter != (container).end(); \ 391 #define forAllConstIter(Container,container,iter) \ 394 Container::const_iterator iter = (container).cbegin(); \ 395 iter != (container).cend(); \ Graphite solid properties.
constexpr auto crend(const C &c) -> decltype(c.rend())
Return const_reverse_iterator to reverse-end of container c.
constexpr auto crbegin(const C &c) -> decltype(c.rbegin())
Return const_reverse_iterator to the reverse-begin of container c.
constexpr const T & max(const T &a, const T &b)
Return the greater of the parameters.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
A functor that returns its argument unchanged (cf. C++20 std::identity) Should never be specialized...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const Vector< label > N(dict.get< Vector< label >>("N"))
constexpr auto rbegin(C &c) -> decltype(c.rbegin())
Return reverse_iterator to the reverse-begin of container c.
constexpr const T & min(const T &a, const T &b)
Return the lesser of the parameters.
const dimensionedScalar c
Speed of light in a vacuum.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
constexpr auto rend(C &c) -> decltype(c.rend())
Return 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.
Namespace for std templates that are are part of future C++ standards or that are in a state of chang...
constexpr T && operator()(T &&val) const noexcept