Usage of Std::optional in LocalAnalyticGridViewFunction incompatible to Apple Clang 10
Disclaimer: This is about the dune-common implementation of Std::optional
not being compatible with the Apple Clang 10 (or at least with its version of libc++
). However, I only encountered errors related to it when trying to compile dune-functions. So I raise this issue here.
Description
Apple Clang 10 added support for std::optional
. The DUNE libraries therefore fall back to using the <optional>
header instead of the DUNE implementation. This clashes with the usage of Std::optional<Geometry>
in Dune::Functions::LocalAnalyticGridViewFunction
. I'm not really sure if the error is in the usage of optional
, or in the incompatible implementations.
This is the compiler error: error.log
Current bug behavior
Dune-functions and downstream modules don't compile with Apple Clang 10.
Expected correct behavior
Everything compiles.
Ideas how to fix this
My current workaround is to comment out any #ifdef DUNE_HAVE_CXX_OPTIONAL
blocks in dune/common/std/optional.hh
, in order to fall back to the DUNE implementation. This works fine.
Edit: My current workaround is to use the CMake flag -DDUNE_HAVE_CXX_OPTIONAL=OFF
, see core/dune-common#130 (closed)