[med-svn] [Git][med-team/camp][upstream] New upstream version 0.8.4

Flavien Bridault gitlab at salsa.debian.org
Mon Dec 9 07:51:28 GMT 2019



Flavien Bridault pushed to branch upstream at Debian Med / camp


Commits:
4c538aa7 by Flavien Bridault at 2019-12-09T07:45:22Z
New upstream version 0.8.4
- - - - -


4 changed files:

- cmake/Config.cmake
- include/camp/detail/issmartpointer.hpp
- include/camp/detail/objecttraits.hpp
- test/property.hpp


Changes:

=====================================
cmake/Config.cmake
=====================================
@@ -2,7 +2,7 @@
 # setup version numbers
 set(VERSION_MAJOR 0)
 set(VERSION_MINOR 8)
-set(VERSION_PATCH 2)
+set(VERSION_PATCH 4)
 set(VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 message("Project version: ${VERSION_STR}")
 


=====================================
include/camp/detail/issmartpointer.hpp
=====================================
@@ -35,56 +35,56 @@
 
 
 #include <camp/detail/yesnotype.hpp>
-#include <boost/utility/enable_if.hpp>
 #include <type_traits>
+#include <memory>
 
 namespace camp
 {
-namespace detail
+
+template<class T>
+T* get_pointer(T *p)
+{
+    return p;
+}
+    
+template<class T>
+T* get_pointer(std::unique_ptr<T> const& p)
 {
+    return p.get();
+}
+
+template<class T>
+T* get_pointer(std::shared_ptr<T> const& p)
+{
+    return p.get();
+}
+
+namespace detail {
+    
 /**
  * \brief Utility class which tells at compile-time if a type T is a smart pointer to a type U
- *
- * To detect a smart pointer type, we check using SFINAE if T implements an operator -> returning a U*
  */
 template <typename T, typename U>
 struct IsSmartPointer
-{
-    enum {value = (!std::is_pointer<T>::value && !std::is_same<T, U>::value) };
+{    
+    enum {value = false};
 };
 
-} // namespace detail
-
-} // namespace camp
-
-
-namespace boost
-{
-/**
- * \brief Specialization of boost::get_pointer for all smart pointer types (const version)
- *
- * This function is specialized for every type T for which IsSmartPointer<T> is true. It makes
- * the stored value available for all boost algorithms (especially for boost::bind).
- */
-template <template <typename> class T, typename U>
-U* get_pointer(const T<U>& obj, typename enable_if<camp::detail::IsSmartPointer<T<U>, U> >::type* = 0)
+template <typename T, typename U>
+struct IsSmartPointer<std::unique_ptr<T>, U>
 {
-    return obj.get();
-}
+    enum {value = true};
+};
 
-/**
- * \brief Specialization of boost::get_pointer for all smart pointer types (non-const version)
- *
- * This function is specialized for every type T for which IsSmartPointer<T> is true. It makes
- * the stored value available for all boost algorithms (especially for boost::bind).
- */
-template <template <typename> class T, typename U>
-U* get_pointer(T<U>& obj, typename enable_if<camp::detail::IsSmartPointer<T<U>, U> >::type* = 0)
+template <typename T, typename U>
+struct IsSmartPointer<std::shared_ptr<T>, U>
 {
-    return obj.get();
-}
+    enum {value = true};
+};
 
-} // namespace boost
+} // namespace detail
+
+} // namespace camp
 
 
 #endif // CAMP_DETAIL_ISSMARTPOINTER_HPP


=====================================
include/camp/detail/objecttraits.hpp
=====================================
@@ -93,7 +93,7 @@ struct ObjectTraits<T*>
 {
     enum
     {
-        isWritable = !boost::is_const<T>::value,
+        isWritable = !std::is_const<T>::value,
         isRef = true
     };
 
@@ -113,7 +113,7 @@ struct ObjectTraits<T<U>, typename boost::enable_if<IsSmartPointer<T<U>, U> >::t
 {
     enum
     {
-        isWritable = !boost::is_const<U>::value,
+        isWritable = !std::is_const<U>::value,
         isRef = true
     };
 
@@ -122,7 +122,7 @@ struct ObjectTraits<T<U>, typename boost::enable_if<IsSmartPointer<T<U>, U> >::t
     typedef typename RawType<U>::Type DataType;
 
     static RefReturnType get(void* pointer) {return static_cast<U*>(pointer);}
-    static PointerType getPointer(T<U> value) {return boost::get_pointer(value);}
+    static PointerType getPointer(T<U> value) {return get_pointer(value);}
 };
 
 /*
@@ -149,7 +149,7 @@ struct ObjectTraits<T&, typename boost::disable_if<boost::is_pointer<typename Ob
 {
     enum
     {
-        isWritable = !boost::is_const<T>::value,
+        isWritable = !std::is_const<T>::value,
         isRef = true
     };
 


=====================================
test/property.hpp
=====================================
@@ -91,7 +91,7 @@ namespace PropertyTest
         const int p6;
         std::string p7_impl; std::string* p7;
         MyEnum p8_impl; const MyEnum* p8;
-        boost::shared_ptr<MyType> p9;
+        std::shared_ptr<MyType> p9;
 
         // ***** member functions *****
         bool p10; bool getP10() {return p10;}



View it on GitLab: https://salsa.debian.org/med-team/camp/commit/4c538aa75ec9198158b97f63a3c0c4a559fa68ff

-- 
View it on GitLab: https://salsa.debian.org/med-team/camp/commit/4c538aa75ec9198158b97f63a3c0c4a559fa68ff
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191209/5e7bccf8/attachment-0001.html>


More information about the debian-med-commit mailing list