diff --git a/src/blockforest/PhantomBlock.h b/src/blockforest/PhantomBlock.h
index 7f42061abc56b1332af0be31cd1fdfbeda83beb3..6afe73bec61d07270a04a6a23fc56acfc9fe739a 100644
--- a/src/blockforest/PhantomBlock.h
+++ b/src/blockforest/PhantomBlock.h
@@ -87,7 +87,13 @@ public:
    template< typename T >
    T getData() const { return walberla::any_cast<T>( data_ ); }
    
-   bool hasData() const { return !(data_.empty()); }
+   bool hasData() const {
+#ifdef WALBELRLA_USE_STD_ANY 
+      return data_.has_value();
+#else
+      return !(data_.empty());
+#endif
+   }
    
    inline       void                             clearNeighborhoodSection  ( const uint_t index );
    inline const std::vector< NeighborBlock * > & getNeighborhoodSection    ( const uint_t index ) const;