mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: relocate zero_one to pTraits, allows reuse for scalar clamping
ENH: add pTraits and IO for std::int8_t STYLE: cull some implicitly available includes - pTraits.H is included by label/scalar etc - zero.H is included by UList STYLE: cull redundant forward declarations for Istream/Ostream
This commit is contained in:
@ -81,7 +81,7 @@ namespace ListPolicy
|
||||
{
|
||||
|
||||
// Override on a per-type basis
|
||||
template<> struct short_length<short> : std::integral_constant<short,20> {};
|
||||
template<> struct short_length<short> : std::integral_constant<int,20> {};
|
||||
|
||||
} // End namespace ListPolicy
|
||||
} // End namespace Detail
|
||||
|
||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
||||
Random rnd(4567);
|
||||
for (scalar& val : someField)
|
||||
{
|
||||
val = rnd.position(-0.2, 1.2);
|
||||
val = rnd.position(scalar(-0.2), scalar(1.2));
|
||||
}
|
||||
|
||||
Info<< nl
|
||||
@ -171,6 +171,7 @@ int main(int argc, char *argv[])
|
||||
// nope << " : " << clamp(val, zero_one{})
|
||||
// nope << " : " << clamp(val, scalarMinMax(zero_one{}))
|
||||
<< " : " << clamp(val, 0, 1)
|
||||
<< " : " << clamp(val, zero_one{})
|
||||
<< nl;
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ Description
|
||||
#include "Switch.H"
|
||||
#include "string.H"
|
||||
#include "dictionary.H"
|
||||
#include "nil.H"
|
||||
#include "zero.H"
|
||||
#include "IOstreams.H"
|
||||
#include "PstreamBuffers.H"
|
||||
#include "argList.H"
|
||||
@ -82,8 +82,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
{
|
||||
nil x;
|
||||
cout<<"nil:" << sizeof(x) << nl;
|
||||
zero x;
|
||||
cout<<"zero:" << sizeof(x) << nl;
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user