summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/borrowed-ptr-fwd.hpp8
-rw-r--r--compat/borrowed-ptr.hpp3
2 files changed, 7 insertions, 4 deletions
diff --git a/compat/borrowed-ptr-fwd.hpp b/compat/borrowed-ptr-fwd.hpp
index 8fcc5dde..48c3e141 100644
--- a/compat/borrowed-ptr-fwd.hpp
+++ b/compat/borrowed-ptr-fwd.hpp
@@ -2,12 +2,18 @@
namespace floormat {
+#define FM_BPTR_DEBUG
+//#define FM_NO_WEAK_BPTR
+
struct bptr_base;
template<typename T> class bptr;
template<typename T> class weak_bptr;
template<typename T> bptr(T* ptr) -> bptr<T>;
-template<typename T> bptr(const T* ptr) -> bptr<const T>;
+
+#ifndef FM_NO_WEAK_BPTR
+template<typename T> weak_bptr(const bptr<T>& ptr) -> weak_bptr<T>;
+#endif
} // namespace floormat
diff --git a/compat/borrowed-ptr.hpp b/compat/borrowed-ptr.hpp
index 76039926..b818154c 100644
--- a/compat/borrowed-ptr.hpp
+++ b/compat/borrowed-ptr.hpp
@@ -1,9 +1,6 @@
#pragma once
#include "borrowed-ptr-fwd.hpp"
-#define FM_BPTR_DEBUG
-#define FM_NO_WEAK_BPTR
-
#ifdef __CLION_IDE__
#define fm_bptr_assert(...) (void(__VA_ARGS__))
#elif defined FM_BPTR_DEBUG && !defined FM_NO_DEBUG