From 632e0507babe06c30342282187b1b733f358a765 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@dune-project.org> Date: Mon, 7 Dec 2009 10:23:03 +0000 Subject: [PATCH] use cast-to-bool to test for shared_ptr validity [[Imported from SVN: r5748]] --- dune/common/mpicollectivecommunication.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dune/common/mpicollectivecommunication.hh b/dune/common/mpicollectivecommunication.hh index fbd5faa04..873ffdc13 100644 --- a/dune/common/mpicollectivecommunication.hh +++ b/dune/common/mpicollectivecommunication.hh @@ -32,7 +32,7 @@ namespace Dune public: static MPI_Datatype get () { - if (type.operator->()==0) + if (!type) { type = shared_ptr<MPI_Datatype>(new MPI_Datatype); MPI_Type_contiguous(sizeof(T),MPI_BYTE,type.operator->()); @@ -86,7 +86,7 @@ namespace Dune public: static MPI_Op get () { - if (op.operator->()==0) + if (!op) { op = shared_ptr<MPI_Op>(new MPI_Op); MPI_Op_create((void (*)(void*, void*, int*, MPI_Datatype*))&operation,true,op.operator->()); -- GitLab