TestStdAny.cpp 404 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
#if defined(WALBERLA_USE_STD_ANY)
#include <any>
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_ANY)
#include <experimental/any>
#endif

int main() {
#if defined(WALBERLA_USE_STD_ANY)
   auto a = std::any(42);
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_ANY)
   auto a = std::experimental::any(42);
#endif
   std::cout << std::experimental::any_cast<int>(a) << std::endl;
   return 0;
}