From 864969d9e589a2e6e465583486988ec92ffb5f54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz>
Date: Wed, 21 Jun 2017 13:44:10 +0200
Subject: [PATCH] Fixed retyping of smart pointers to bool

---
 src/TNL/DevicePointer.h | 6 ++++--
 src/TNL/SharedPointer.h | 6 ++++--
 src/TNL/UniquePointer.h | 6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/TNL/DevicePointer.h b/src/TNL/DevicePointer.h
index ce734107d9..fab718cf1d 100644
--- a/src/TNL/DevicePointer.h
+++ b/src/TNL/DevicePointer.h
@@ -113,7 +113,8 @@ class DevicePointer< Object, Devices::Host > : public SmartPointer
          return *( this->pointer );
       }
 
-      operator bool()
+      __cuda_callable__
+      operator bool() const
       {
          return this->pointer;
       }
@@ -280,7 +281,8 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer
          return *( this->pointer );
       }
 
-      operator bool()
+      __cuda_callable__
+      operator bool() const
       {
          return this->pd;
       }
diff --git a/src/TNL/SharedPointer.h b/src/TNL/SharedPointer.h
index 97109e9119..c1a3e06347 100644
--- a/src/TNL/SharedPointer.h
+++ b/src/TNL/SharedPointer.h
@@ -161,7 +161,8 @@ class SharedPointer< Object, Devices::Host > : public SmartPointer
          return this->pd->data;
       }
 
-      operator bool()
+      __cuda_callable__
+      operator bool() const
       {
          return this->pd;
       }
@@ -395,7 +396,8 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer
          return this->pd->data;
       }
 
-      operator bool()
+      __cuda_callable__
+      operator bool() const
       {
          return this->pd;
       }
diff --git a/src/TNL/UniquePointer.h b/src/TNL/UniquePointer.h
index 1367cab5ad..01765d51b1 100644
--- a/src/TNL/UniquePointer.h
+++ b/src/TNL/UniquePointer.h
@@ -61,7 +61,8 @@ class UniquePointer< Object, Devices::Host > : public SmartPointer
          return *( this->pointer );
       }
       
-      operator bool()
+      __cuda_callable__
+      operator bool() const
       {
          return this->pointer;
       }
@@ -148,7 +149,8 @@ class UniquePointer< Object, Devices::Cuda > : public SmartPointer
          return this->pd->data;
       }
       
-      operator bool()
+      __cuda_callable__
+      operator bool() const
       {
          return this->pd;
       }
-- 
GitLab