From 11b54e7ceda94217e918723f1c6eda9c4d8b4ad7 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 28 Jul 2009 09:06:06 +0000 Subject: [PATCH] Added implicit conversion from VectorView to const Vector git-svn-id: https://svn.dealii.org/trunk@19123 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/vector_view.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deal.II/lac/include/lac/vector_view.h b/deal.II/lac/include/lac/vector_view.h index c655384bef..7060bdefd6 100644 --- a/deal.II/lac/include/lac/vector_view.h +++ b/deal.II/lac/include/lac/vector_view.h @@ -164,6 +164,15 @@ class VectorView : public Vector * memory. */ ~VectorView(); + /** + * Implicit cast to const + * Vector. This cast + * allows the use of this object + * everywhere a const + * Vector is required. + */ + operator const Vector &() const; + /** * The reinit function of this object has * a behavior which is different from the @@ -275,6 +284,13 @@ VectorView::~VectorView() } +template +inline +VectorView::operator const Vector &() const +{ + return static_cast &> (*this); +} + template inline -- 2.39.5