CXXFeatures.cmake 297 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
include(CheckCXXSourceCompiles)

# support for C++17's variant implementation
check_cxx_source_compiles("
  #include <variant>
  int main()
  {
    std::variant<int,double> a;
    a = 1;
    a = 2.0;
    bool positive = std::visit([](auto&& x) { return x > 0; }, a);
  }
" DUNE_HAVE_CXX_VARIANT )