Comments (8)
Okay, that's a fair point. I don't particularly sympathize with anyone who gets all sorts of errors when they use using namespace std
, but we probably don't want to contribute any more to the confusion.
from ekat.
If you issue, say, using std::min
in your app code, then I believe that min(a,b)
should work, no?
from ekat.
Actually, we are already providing min/max in ekat_math_utils.hpp. Does your code compile if you include that header? I guess we could add a similar one for abs
in that file...
from ekat.
The ones in ekat_math_utils.hpp
seem to be under the ekat::impl
namespace, which suggests "no touchy!". But yeah, we could just use these. Is there any reason to stash them in the impl
namespace?
from ekat.
Ah, yeah, you're right. I guess we put them there to not explicitly pollute ekat's namespace, in case the user does using namespace ekat
, but doesn't want these overloads.
from ekat.
It seems like a user who includes that header might not mind having those functions available in the ekat
namespace. Otherwise they get only theis_invalid
and transpose
functions.
from ekat.
I think that names like max or min are so common that it would be somewhat dangerous to inject them into ekat's namespace. I can see apps doing using namespace ekat
, but if they also are doing (ugh) using namespace std
(or any other library namespace that declares max/min), then there might be compile/link errors (or worse, runtime ones).
I'm ok moving unambiguous names outside of the impl namespace, but max/min (and even isfinite) are shared with the std lib, which imho is too dangerous to do it by default. If someone is interested in getting those functions, they can do using namespace ekat::impl
. It's a one line price to pay, but it gives more security long term.
from ekat.
I agree, using the std namespace is not a great practice. But on the other hand, there are likely other libs that may overload such common name functions...
from ekat.
Related Issues (20)
- Change default internal storage of arrays in ParameterList, when parsing a YAML file
- Allow user to extend set of supported types for YAML parsing/writing.
- The tridiag tests are not really run, but report pass
- Make genRandArray accept 64 bit ints for the array length
- Allow specific log filenames to be supplied to `ekat::logging::Logger` HOT 2
- TPL Catch2 is incomplete HOT 8
- Potential problem in WSM with take/release
- EKAT valid_nested_list_format uses size_t for an integer, num_open, that might go negative HOT 1
- Remove assumption of CudaUVM in order to create Host team policies
- Current kokkos submodule reference is not a tree HOT 1
- Add SYCL/HIP testing to PR testing
- Need to update setting of C++ standard in ekat CMakeLists.txt
- Append to rather than set CXXFLAGS, etc. HOT 4
- Do not make EKAT enable FPEs during initialize_ekat_session HOT 4
- Expand view_reduction to handle array of accumulators.
- Potential problem with ExeSpaceUtils view_reduction and parallel_reduce HOT 5
- Potential fix for Apple silicon build HOT 10
- Add stacktrace information to assert macros HOT 3
- EKAT's use of `find_package` for Kokkos requires CMake 3.24 HOT 2
- Update cmake minimum version HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ekat.