-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove SFINAE in some places #3
Conversation
03631f0
to
e1f7d9e
Compare
5456ff3
to
a00a664
Compare
Occurrences of
|
@@ -898,18 +841,36 @@ namespace detail | |||
} | |||
}; | |||
|
|||
namespace bool_repr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for now a duplication of the same code inside AttributeTypes< bool >
. The latter will be removed as soon as the new ADIOS2 schema is fully removed.
@franzpoeschel can you please rebase this? |
a00a664
to
eb39562
Compare
* Remove: MPark.Variant (internal) * CMake: C++17 * Docs: w/o MPark.Variant * Docs: C++17 * Remove C++14-only Code * Variant/Option: only `std::variant` as source * CI: Clang 5->6, GCC 5->7 * Clang6: Ubuntu 20.04 The shipped libstd++ (GCC10?) does not seem to work well with Clang 6 on Ubuntu 18.04 - try again on Ubuntu 20.04. * clang-tidy-10: namespace & nodiscard C++17 modernizations that it found: - `modernize-concat-nested-namespaces` - `modernize-use-nodiscard` * macOS: raise deployment target to 10.13 ``` error: 'visit<(lambda at ...include/openPMD/backend/Attribute.hpp:239:9), std::variant<...> &>' is unavailable: introduced in macOS 10.13 ``` `std::filesystem` needs macOS 10.15: ``` share/openPMD/thirdParty/toml11/toml/parser.hpp:2166:65: error: 'path' is unavailable: introduced in macOS 10.15 basic_value<Comment, Table, Array> parse(const std::filesystem::path& fpath) ^ /Applications/Xcode_13.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/filesystem:902:24: note: 'path' has been explicitly marked unavailable here class _LIBCPP_TYPE_VIS path { ^ ``` * clang6 on Linux: use libc++ Issues with clang 6 on `<variant>` from GCC's libstdc++: - https://stackoverflow.com/a/46507150/2719194 - https://bugs.llvm.org/show_bug.cgi?id=31852 - https://bugs.llvm.org/show_bug.cgi?id=33222 Using libc++: - https://libcxx.llvm.org/UsingLibcxx.html * Add a Clang 7 build * add libc++abi-dev * Clang 6: `-Wno-ignored-attributes -Wno-unused-const-variable` clang-6 has a false positive on `src/auxiliary/Filesystem.cpp` with `-Wno-ignored-attributes`: ```C++ [[maybe_unused]] MPI_Datatype const MPI_Types< unsigned >::value = MPI_UNSIGNED; ``` Adding only `-Wno-ignored-attributes` then leads to: ``` src/auxiliary/Filesystem.cpp:201:47: error: unused variable 'value' [-Werror,-Wunused-const-variable] MPI_Datatype const MPI_Types< unsigned >::value = MPI_UNSIGNED; ^ ``` * README: C++17 Structure Bindings Modernize "first read" C++ example with structured bindings * Doc: Support Clang 7+ For `<variant>`, clang 6 is not to be recommended for C++17 compilation unless by expert users that know how to change the stdlib. Thus, let's only recommend Clang 7+. Ubuntu 18.04 (bionic/oldstable) ships clang 6 by default, but Ubuntu 20.04 (focal/stable) is already at clang 10. * C++17: Replace auxiliary::Option with std::optional * Replace auxiliary::Option with std::optional * Remove SFINAE in some places (#3) * switchType: avoid SFINAE constructs * Remove template specializations: oldCreateAttribute, oldReadAttribute * CI fixes Co-authored-by: Franz Pöschel <franz.poeschel@gmail.com>
With
if constexpr
we can now often avoid SFINAE constructs, making code easier to read and faster to compileAttributeTypes
class in ADIOS2 uses specializations to enable different implementations of attributes based on type. This has always been annoying to read because each function was defined like 10 times.Not yet inlined:
attributeUnchanged
(will do),(new)createAttribute, (new)readAttribute
(won't do, these will be removed anyway along with the new schema).The
AttributeTypes
class can then fully be removed.TODO: Remove SFINAE and similar constructs in other places. Search for
enable_if
.